In this article we would be sharing just the steps to create a queue in WebSphere MQ 7 which can be used with JBoss to send or receive message from a remote box which would be in our next article. Now normally everyone has a separate box on which the WebSphere MQ 7 is been installed and another box on which JBoss is running, hence in this scenario things get little different as the queue which has to be created should be accessed by a remote box where lot of people get stuck and we were one of them too.

As we were not from a background of WebSphere MQ, it was difficult for us to configure the queue and other configuration properly so that it can be accessed by a remote server. After lot of research and struggle we were able to get the configuration correct and working hence we would like to share our findings with you as always.

Following are the details from where you can register yourself to download WebSphere MQ 7, installation of it and the complete steps to create a remote queue in WebSphere MQ 7 which would be accessible from a remote server.

Download Link:

You can download “Evaluate: IBM WebSphere MQ” version V7.1 from the below link, however if you do not have an account opened yet you can register yourself from the link

Download LinkEvaluate: IBM WebSphere MQ version V7.1

Registration Link My IBM registration

Installation Steps:

You can follow the steps given in the below given IBM docs link which would share you all the methods of installation

Installation Steps LinkWebSphere MQ Server installation methods

Steps to Create A Remote Queue in WebSphere MQ 7:

Here are the complete steps which would help you creating a remote queue in WebSphere MQ 7 with screen-shorts for your convince hope it would help.

Creating a Queue Manager:

  1. Right-click on “Queue Managers” and select “New” -> “Queue Manager
  2. Enter the name for “Queue manager name:” and click 3 times Next, however you can change the default setting if you feel like.
  3. You can change the “Listen on port number” if you have other Queue Manger running on default port which is 1414 then click Next and Finish.

Creating a Queue:

  1. Right-click on “Queues” under the Queue Manager which we created and select “New” -> “Local Queue
  2. Enter the name for Queue “Name” and click “Next” and then “Finish“, however you can change the default setting if you feel like.

Creating a Channels:

  1. In your Queue Manager, click the (+) for “Advanced” and then right-click on the “Channels” and select “New” -> “Server-connection Channel
  2. Enter the name for the Channel “Name” and click “Next
  3. Now you would have to make sure that you have given the correct value for “MCA user ID“, if you have kept it blank then you would see the below error when a client would try to look up.
  4. Remote_MQ]$ java QueueReceive 10.10.10.10:1415/MyRemoteChannel
    Exception in thread "main" javax.naming.NamingException: Unable to connect to the admin queue. Exception was: com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'MyRemoteMQMgr' with connection mode 'Client' and host name '10.65.211.223'. Please check if the supplied username and password are correct on the QueueManager you are connecting to [Root exception is com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'MyRemoteMQMgr' with connection mode 'Client' and host name '10.65.211.223'. Please check if the supplied username and password are correct on the QueueManager you are connecting to]
    	at com.ibm.mq.jms.context.MQContext.<init>(MQContext.java:318)
    	at com.ibm.mq.jms.context.WMQInitialContextFactory.getInitialContext(WMQInitialContextFactory.java:29)
    	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
    	at javax.naming.InitialContext.init(InitialContext.java:223)
    	at javax.naming.InitialContext.<init>(InitialContext.java:197)
    	at QueueReceive.getInitialContext(QueueReceive.java:102)
    	at QueueReceive.main(QueueReceive.java:77)
    Caused by: com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'MyRemoteMQMgr' with connection mode 'Client' and host name '10.65.211.223'. Please check if the supplied username and password are correct on the QueueManager you are connecting to
    	at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:531)
    	at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:219)
    	at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:410)
    	at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:7855)
    	at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:7331)
    	at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:276)
    	at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6055)
    	at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:144)
    	at com.ibm.mq.jms.context.MQContext.<init>(MQContext.java:311)
    	... 7 more
    Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').
    	at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:206)
    
  5. You can also make the “SSL” as “Optional” and click OK

Creating JMS Administered Objects:

  1. In your Queue Manager and then right-click on the “JMS Administered Obejects” and select “Add Initial Context
  2. Now select the

    1. Radio button for “Other”
    2. Factory class = com.ibm.mq.jms.context.WMQInitialContextFactory
    3. Required libraries=//mqcontext.jar
    4. Provider URL = :/
    5. Click 3 times “Next” and then “Finish“, however you can change the default setting if you feel like.
  3. Once this is done you would see “10.10.10.10:1415/MyRemoteChannel” is “Connected” and “MyRemoteChannel” created would also be “Running” now.
  4. Now you would have to use the connection factories name given in the “10.10.10.10:1415/MyRemoteChannel” => Connection Factories => Name (i.e. it would be similar name of your Queue Manager)

This way you would be able to create a remote queue in WebSphere MQ 7 and in our next article we would be sharing the code on how to connect this queue with JBoss, so stay tuned…