Get channel table file from remote server

2019-06-06 13:55发布

问题:

I'm trying to set ccdturl with the ccdt file which located in a remote server. I tried to set ccdt url using ftp but it does not work out. Does anyone know what is the correct way to set url for ccdt file in remote server? Thanks!

I tried:

String channelTablePath = "ftp://user@host:/path-to-ccdt-file";
Url url = new URL(channelTablePath );
connectionFactory.setCCDTURL(url); 

The error that I get is:

Exception in thread "main" javax.jms.JMSException: JMSWMQ2020: Failed to connect                                                                                              to queue manager '*QQ' with connection mode 'Client' and supplied CCDT URL 'ftp://user@host:/path/ccdt.tab',                                                                                              see linked exception for more information.
JMS Error code: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2278' ('MQRC_CLIENT_CONN_ERROR').
EXPLANATION:
The filesystem returned error code 'java.net.ConnectException[Connection timed
out]' for file 'ftp://user@host:/path/ccdt.tab'.
ACTION:
Record the name of the file 'ftp://user@host:/path/ccdt.tab'
and tell the systems administrator, who should ensure that file 'ftp://user@host:/path/ccdt.tab'
is correct and available.

回答1:

Summary:

You should not have a colon (:) after the host in the URL. You should specify a password value in the URL if required. You also need to specify the name of the ccdt file. References to the IBM Knowlege center at at the end of this answer.

Try the following value instead:

String channelTablePath = "ftp://user:pass@host/path-to-ccdt-file/AMQCLCHL.TAB";

The IBM MQ v9 Knowledge center page "Using a client channel definition table with IBM MQ classes for JMS" states:

As another example, suppose the file ccdt2.tab contains a client channel definition table and is stored on a system that is different from the one on which the application is running. If the file can be accessed using the FTP protocol, the application can set the CCDTURL property in the following way:

java.net.URL chanTab2 = new URL("ftp://ftp.server/admdata/ccdt2.tab");
factory.setCCDTURL(chanTab2);

The IBM MQ v9 Knowledge center page "Web addressable access to the client channel definition table" shows an example of a FTP URL with username and password:

Authenticated connections

export MQCHLLIB=ftp://myuser:password@myhost.sample.com/var/mqm/qmgrs/QMGR/@ipcc
export MQCHLLIB=http://myuser:password@myhost.sample.com/var/mqm/qmgrs/QMGR/@ipcc

...

Note

If you want to use authenticated connections you must, as with JMS, provide the user name and password encoded in the URL.



标签: java ftp ibm-mq