Friday, July 1, 2016

Generate MQ Bindings

If you need to generate MQ bindings, here are the steps:

1. Create a dir

2. Copy JMSAdmin.config to this dir. Make sure the file has the following entries
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
PROVIDER_URL=file://

3. Create a file intsetup.scp with the following contents:
def qcf(ivtQCF) qmgr(QMOD01) transport(CLIENT) host(119.81.206.86) channel(SYSTEM.DEF.SVRCONN) port(1414)
DEFINE Q(TMMQ) QUEUE(TMMQ) TC(MQ)
DEFINE Q(ODINMQ) QUEUE(ODINMQ) TC(MQ)
DEFINE Q(ODOUTMQ) QUEUE(ODOUTMQ) TC(MQ)
end

4. Create a shell script gen_bindings.sh with the following contents:
export PATH=$PATH:$MQ_ROOT/bin:$MQ_ROOT/java/bin:$MQ_ROOT/samp/bin:$MQ_ROOT/samp/jms/samples:/var/mqm
export CLASSPATH=/opt/mqm/java/lib/com.ibm.mq.allclient.jar:/opt/mqm/java/lib/jms.jar:/opt/mqm/java/lib/providerutil.jar

java com.ibm.mq.jms.admin.JMSAdmin < intsetup.scp

5. The bindings file (.bindings) will be created in this dir 


Note, if you need to regenerate, delete .bindings file first (or you may get an error saying unable to bind)

References:
http://ibmstreams.github.io/streamsx.documentation//docs/4.1/messaging/mq-create-objects-bindings-sample/
http://www.ibm.com/support/knowledgecenter/SSYLSL_9.3.0/com.ibm.help.integ.jms.doc/t_CreatingJMSBindingsInIBMWebSphereMQ.html


No comments:

Post a Comment