Services: Training Services | Consulting Services
WebSphere MQ queue manager 'QM_TEST' starting.
5 log records accessed on queue manager 'QM_TEST' during the log replay phase.
Log replay for queue manager 'QM_TEST' complete.
Transaction manager state recovered for queue manager 'QM_TEST'.
WebSphere MQ queue manager 'QM_TEST' started.
Create a listener for port 1450
nohup runmqlsr -m QM_TEST -t TCP -p 1450 &
ps -ef | grep -i runmqlsr
You can use endmqlsr for example endmqm -i QM_TEST to force the QM to stop immediately
============== OR ===========
You can also create an MQ Listener using the MQSC environment
DEFINE LISTENER (TEST1450) +
TRPTYPE (TCP) +
PORT (1450) +
If we use an MQ command "runmqlsr" to start a listener, then we cannot give it a name, and we need to start it manually every time the Queue Manager is started or restarted.
By using the MQSC environment, we can set options for the Listener to start when the Queue Manager starts, the control option above CONTROL(QMGR) allows the listener to be restarted when the QM is restarted.
Because we have set a default Queue Manager we can just use runmqsc to run the MQSC to confgure or display the listener
AMQ8630: Display listener information details.
IPADDR( ) BACKLOG(0)
DESCR( ) ALTDATE(2011-02-02)
Shortcut command line
same as: echo 'display listener(TEST1450)' | runmqsc
This will create a listener TEST1450 using TCP and port 1450 and when the QMgr is started or stopped the listener will do the same. If the listener ends for any reason you can restart manually with this runmqsc command:
To check the status of listener:
Before you try and connect, it is a good idea to set DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) for test environment using runmqsc, which allows remote administration of a Queue Manager using MQ Explorer. Remember that MQ authentication is all about users/groups, so you may have to alter the userid to tell MQ explorer to connect as a specific MQ user which is a valid user in the'mqm' group on the MQ server in my case the server is Linux.
Setting the user name to mqm so I can connect to the Queue Manager.
Once a client channel has been created as seen in the setupMQ.mqsc script below, you can connect to the client channel using MQ Explorer
Here is the Java code.
Note: Once you have created the server to client channel then the Java client will be able to connect to MQ server
I have not written everything down (Will let you do some of the reading between the lines and leg work) , but it should give an introduction of how to create and test a simple MQ java client.
Steve Robinson has been working in IT for over 20 years and has provided solutions for many large-enterprise corporate companies across the world. Steve specialises in Java and Middleware.
In January 2013, I was awarded the prestigous 'IBM Champion' accolade.
IBM WebSphere Application Server 8.0 Administration Guide
WebSphere Application Server 7.0 Administration Guide
Contact | Articles | Shell Scripts | Java Code | JACL | Jython | WebSphere MQ | WebSphere Message Broker | WebSphere Blog | © Copyright 2006-2013 Robinson (UK) Limited