FreeKB - How to create a queue connection factory in WebSphere
How to create a queue connection factory in WebSphere

Home > Search > How-to


Before setting up JMS (Java Message Service) components in WebSphere, you may first want to check out our MQ Getting Started article. "Connection factory" is the term that is used for how a Java application connects to a JMS queue, such as an IBM MQ queue or a RabbitMQ queue.

  1. In the WebSphere admin console, expand Resources > JMS.
  2. Select Connection factories.
  3. In the scope drop-down selector, select a scope.
  4. Select New.
  5. Choose WebSphere MQ Messaging Provider and select OK.

At Step 1: Configure basic attributes, give the queue connection factory name a name and JNDI. In this example, the name of the queue is "queue01cf" with a JNDI of "jms/queue01cf".

‚Äč

At Step 2: Select connection method, select Enter all required information into this wizard and select Next.

At Step 2.1: Supply queue manager details, enter the name of the queue manager. If you have access to the IBM MQ server, the dspmq command can be used to display the queue managers on the MQ server.

At Step 2.2: Enter connection details, if there is a single MQ server, select Enter host and port information in the form of separate hostname and port values and enter the hostname and port of the MQ server and the channel. If you are not sure the port and you have access to the MQ server, the runmqsc command can be used to determine the listener port. If you are not sure the name of the channel, the runmqsc command can be used to display the channels.

If there are two or more MQ servers, select Enter host and port information in the form of connection name list and enter the hostname and port in a comma separated list. 

Select Test Connection.

In this example, after selecting Test ConnectionA connection was successfully made to IBM MQ is returned. An error message may be returned if the MQ server requires a secured connection of SSL, as the SSL setup is done after the queue connection factory has been created.

 

Select Next > Finish > SaveRestart the dmgr so that the queue connection factory is bound to the dmgr. The connection factory should now be found in the resources.xml file on the server. Likewise, the dmgr HPEL or SystemOut.log will show the queue connection factory being bound to the dmgr.

WSVR0049I: Binding queue01cf as jms/queue01cf queue01cf

 

Refer to this article for a walkthrough on how to write a Java application that can PUT a JMS message on an MQ queue using the WebSphere queue connection factory.

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 224b4 in the box below so that we can be sure you are a human.




Comments