Unable to connect to mq jms remotely.

Unable to connect to mq jms remotely.

book

Article ID: KB0091043

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
Here are the steps to connect to remote MQ server:

On server side:
1 Installed IBM WebSphere MQ on the Server.
In addition to this step, following important things should be noted:
a>    Create a Server-Connection Channel, Commit MCA USER ID to current login user (this user must have MQ authorization).
b>    MQ Queue Manager’s CCSID is important at later stage.

2 Make sure that the dlls under "&ltinstallDir>\bin" and "&ltinstallDir>\java\lib" is in the system PATH, also check that the jars from this location "&ltinstallDir>\java\lib" are included in the CLASSPATH, in my tests MQ installer added these automatically.

3 Newly created MQSeries queue is still not ready for use by the JMS API. It needs to be exposed and this is done via the JMSAdmin tool, you need to create JMS administered objects using JMSAdmin tool.

4 Go to &ltinstallDir>\Java\bin dir. Edit the JMSAdmin.config file to use file based JNDI interface as this is the easiest.
   INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
   PROVIDER_URL=file:/C:/IBM/WebSphereMQ/Java/bin

5 Start JMSAdmin tool and the prompt

5a. create a JMS queue: Eg;
-DEFINE QCF(MQ_JMS_MANAGER) qmgr(QM2) TRAN(CLIENT) HOST(192.168.66.207) PORT(2000) CCSID(1381)
-DEFINE Q(JNDImyQueue)  QUEUE(myQueue)

Where Host is the server host.

5b. Here JNDImyQueue is the JNDI name which is linked to the actual MQSeries queue 'myQueue' which is defined using MQ Explorer. Once you have done this, you will see a file called ".bindings" created under PROVIDER_URL


On Client machine:
1, copy the ".bindings" file and MQ Java lib folder (from Server side) to Client machine.

2 include MQ Java lib in deisgner.tra classpath. Eg; In designer.tra I have following settings: C:/MQ/Java/lib added to tibco.env.CUSTOM_CP_EXT

3 In Designer project for JMS Connection, these are the settings:
JNDI Context Factory: com.sun.jndi.fscontext.RefFSContextFactory
JNDI Context URL: file:/C:/ JNDI-Directory (I put the .binding file in this folder)
MQ_JMS_MANAGER is my QueueConnectionFactory name.
Please validated with a successful connection.

Issue/Introduction

Unable to connect to mq jms remotely.