问题
Can someone please help me to get/read the port number, hostname, channel details when i using ccdt.tab file. these details were configured in tab file. queue creation was opened successfully by using tab file but i want to get above details (connection details) using java.
I can able to get only queue manager name and queue name by using MQQueueSender.getstringproperty(); but other not able to find.
I expect port number, hostname, channel which i defined in TAB file
MQQueueConnection connection = null;
MQQueueSession session = null;
MQQueueSender sender = null;
MQQueueReceiver receiver = null;
HashMap<String, String> setValue = null;
try {
connection = getConnection(prop.getProperty("tabFilePath"));
session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
MQQueue sendQueue = (MQQueue) session.createQueue(prop.getProperty("queueName"));
sender = (MQQueueSender) session.createSender(sendQueue); System.out.println(sender.getStringProperty("XMSC_WMQ_RESOLVED_QUEUE_MANAGER"));
System.out.println(sender.getStringProperty("XMSC_WMQ_QUEUE_MANAGER"));
回答1:
There is no MQ API or Class that will parse a CCDT file for an MQ application.
Set the environment variables MQCHLLIB and MQCHLTAB to point to where your CCDT file located and then use runmqsc with the '-n' parameter to have MQ manage it then issue the following MQSC command:
DIS CHL(*) ALL
Now you will have all of the details of all CLNTCONN channels from the CCDT file.
来源:https://stackoverflow.com/questions/58662317/how-to-retrieve-the-connection-details-from-tab-file-mq