how to configure a remote queue definition to demonstrate MQ intercommunication.
MQ December 12, 2009
In this example I am going to briefly demonstrate MQ intercommunication. What I mean by intercommunication is allowing a message to be put on a local queue on a local queue manager and to have that message sent to a remote queue on a remote queue manager.
For intercommunication to occur you need to create MQ channels. Channel objects provide a means for local queues to talk to connect to remote queues. You could say that channel object come in pairs. One sender and one receiver i.e that is two ends of a channel must exist.Messages flow one-way in a channel. If you wish two queue managers remote to each other to communicate then you must have a local queue and remote queue definition with a channel set-up for each direction. This means you needs one channel for sending left to right and a different channel for sending from right to left. In other words for a sender to receive and receiver to send you must define two serrate channels.
In intercommunication we also need listeners created and running with TCP / Port settings set accordingly for each end of the channel.
I am going to create two queue managers, one called qm.apple which will be my receiving queue and another called qm.orange which will be the sending queue manager.
First we are going to create our first queue manager. First install WebSphere MQ. I am currently using WebSphere MQ version 6 on Linux.
By using the command crtmqm without the -q switch the queue is not the default queue.
crtmqm qm.apple
WebSphere MQ queue manager created.
Creating or replacing default objects for qm.apple.
Default objects statistics : 40 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
If we run the command strmqm we get: AMQ8118: WebSphere MQ queue manager does not exist. This is due tot the fact we have no default queue manager. Now we are going to create the sending queue manager qm.orange.
crtmqm -q qm.orange
WebSphere MQ queue manager created.
Creating or replacing default objects for qm.orange.
Default objects statistics : 40 created. 0 replaced. 0 failed.
Completing setup.
strmqm
WebSphere MQ queue manager 'qm.orange' starting.
5 log records accessed on queue manager 'qm.orange' during the log replay phase.
Log replay for queue manager 'qm.orange' complete.
Transaction manager state recovered for queue manager 'qm.orange'.
WebSphere MQ queue manager 'qm.orange' started.
You can see that since I used the -q switch the qm.orange queue manager is now the default queue manager and when I issue the strmqm command it is able to start the default queue manager. To start qm.apple I type strmqm qm.apple
strmqm qm.apple
WebSphere MQ queue manager 'qm.apple' starting.
5 log records accessed on queue manager 'qm.apple' during the log replay phase.
Log replay for queue manager 'qm.apple' complete.
Transaction manager state recovered for queue manager 'qm.apple'.
WebSphere MQ queue manager 'qm.apple' started.
We now have two queue managers. What we want to do now is create a queue to receive messages on qm.apple. Do do this we use the command line utility called MQSC. The command is runmqsc. It is a command line interpreter which executes MQ confirmation command to adjust MQ object settings. if we type runmqsc we will automatically start the MQSC tool for the default queue manager.
runmqsc qm.apple
runmqsc qm.apple
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.apple.
define qlocal(q1)
1 : define qlocal(q1)
AMQ8006: WebSphere MQ queue created.
end
2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
What we need to do now is create a listener for the qm.apple which allows our sending queue manager (qm.orange) to connect via channel. We are going to make the listener use port 30000. If you follow the link above which explains a listener you can learn what the default port is.
runmqsc qm.apple
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.orange.
define listener(qm.apple.listener) trptype(TCP) port(30000)
1 : define listener(qm.apple.listener) trptype(TCP) port(30000)
AMQ8626: WebSphere MQ listener created.
start listener(qm.apple.listener)
2 : start listener(qm.apple.listener)
AMQ8021: Request to start WebSphere MQ Listener accepted.
end
3 : end
2 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
What we are going to do now is create a listener for qm.orange. You may think, why do we need a listener for qm.orange when it is the sending queue manager? Well it is because to use MQ Explorer form a remote machine i.e. my windows machine to administer MA on my Linux box I will need to connect as a client to the queue managers via their listeners.
runmqsc qm.orange
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.orange.
define listener(qm.orange.listener) trptype(TCP) port(30001) ipaddr(192.168.0.60)
1 : define listener(qm.orange.listener) trptype(TCP) port(30001) ipaddr(192.168.0.60)
AMQ8626: WebSphere MQ listener created.
start listener(qm.orange.listener)
2 : start listener(qm.orange.listener)
AMQ8021: Request to start WebSphere MQ Listener accepted.
end
3 : end
2 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
You will notice in this listener I added the ipaddr parameter this is to show that you can see what ipaddress you wish to listen on. This is key for intercommunication. Remember firewalls will need to be configures if you have them to allow communication on these ports.
If we look at the running listener proceses.
ps -ef | grep runmqlsr
mqm 17609 17471 0 08:50 ? 00:00:00 /opt/mqm/bin/runmqlsr -r -m qm.orange -t TCP -p 30001 -i 192.168.0.60
mqm 17636 17526 0 08:56 ? 00:00:00 /opt/mqm/bin/runmqlsr -r -m qm.apple -t TCP -p 30000
You can see that MQ is running the command runmqlsr and the qm.apple listern is not bound to a specific ipaddress. What we will do not is alter the qm.apple listener.
runmqsc qm.apple
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.apple.
alter listener(qm.apple.listener) ipaddr(192.168.0.60)
1 : alter listener(qm.apple.listener) ipaddr(192.168.0.60)
AMQ8405: Syntax error detected at or near end of command segment below:-
alter listener(qm.apple.listener) ipaddr
AMQ8427: Valid syntax for the MQSC command:
ALTER LISTENER(listener_name)
TRPTYPE( TCP | SPX | NETBIOS | LU62 )
alter listener(qm.apple.listener) trptype(tcp) ipaddr(192.168.0.60)
2 : alter listener(qm.apple.listener) trptype(tcp) ipaddr(192.168.0.60)
AMQ8623: WebSphere MQ listener changed.
end
3 : end
2 MQSC commands read.
One command has a syntax error.
All valid MQSC commands were processed.
As you can see a typing mistake and so MQSC will prompt with an error to show some information to lead you in the right direction. Note that it doesn't always tell you all the command options in complete detail, this is something you will have to read in help documentation.
We will have to bounce the listener for the ipaddress parameter to take effect.
runmqsc qm.apple
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.apple.
stop listener(qm.apple.listener)
1 : stop listener(qm.apple.listener)
AMQ8706: Request to stop WebSphere MQ Listener accepted.
start listener(qm.apple.listener)
2 : start listener(qm.apple.listener)
AMQ8021: Request to start WebSphere MQ Listener accepted.
end
3 : end
2 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
OK we now have to running queue managers with appropriate listeners. What we need to do now is create a transmission queue on qm.orange. We require a transmission queue to be able to talk to a channel object. We use a channel to allow qm.orange to talk to qm.apple. We will also need to create a remote queue definition which will represent our remote queue q1 on qm.apple which we want to send messages to.
runmqsc qm.orange
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.orange.
define qlocal (qm.orange.tq) usage(xmitq)
1 : define qlocal (qm.orange.tq) usage(xmitq)
AMQ8006: WebSphere MQ queue created.
end
2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
runmqsc
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.orange.
define qremote(q1) rname(q1) rqmname(qm.apple) xmitq(qm.orange.tq)
1 : define qremote(q1) rname(q1) rqmname(qm.apple) xmitq(qm.orange.tq)
AMQ8006: WebSphere MQ queue created.
end
2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
We have created the transmission queue and and a remote queue definition, we still need to create the channel object, but before we do lets use MQ explorer to see what we have created.
Before we can actually look at the queue managers we need to ensue that MQ explorer can connect to the queue managers, to do this we need to ensure that both queue managers have special channel created called SYSTEM.ADMIN.SVRCONN.
The server-connection channel, called SYSTEM.ADMIN.SVRCONN, must exist on every remote queue manager you need to manage using MQ explorer i.e. remote to the machine where you are running MQ Explorer. This channel is mandatory for every remote queue manager being administered by WebSphere MQ Explorer. Without it, remote administration is not possible.
runmqsc qm.apple
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.apple.
DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN)
1 : DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN)
AMQ8014: WebSphere MQ channel created.
start channel(SYSTEM.ADMIN.SVRCONN)
2 : start channel(SYSTEM.ADMIN.SVRCONN)
AMQ8018: Start WebSphere MQ channel accepted.
end
3 : end
2 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
Do the same for qm.orange. We can now connect to the queue managers. Run MQ Explorer. Remember in my example MQ explorer is running on my windows laptop where MQ is running on my remote Linux machine.
MQ
For intercommunication to occur you need to create MQ channels. Channel objects provide a means for local queues to talk to connect to remote queues. You could say that channel object come in pairs. One sender and one receiver i.e that is two ends of a channel must exist.Messages flow one-way in a channel. If you wish two queue managers remote to each other to communicate then you must have a local queue and remote queue definition with a channel set-up for each direction. This means you needs one channel for sending left to right and a different channel for sending from right to left. In other words for a sender to receive and receiver to send you must define two serrate channels.
In intercommunication we also need listeners created and running with TCP / Port settings set accordingly for each end of the channel.
I am going to create two queue managers, one called qm.apple which will be my receiving queue and another called qm.orange which will be the sending queue manager.
First we are going to create our first queue manager. First install WebSphere MQ. I am currently using WebSphere MQ version 6 on Linux.
By using the command crtmqm without the -q switch the queue is not the default queue.
crtmqm qm.apple
WebSphere MQ queue manager created.
Creating or replacing default objects for qm.apple.
Default objects statistics : 40 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
If we run the command strmqm we get: AMQ8118: WebSphere MQ queue manager does not exist. This is due tot the fact we have no default queue manager. Now we are going to create the sending queue manager qm.orange.
crtmqm -q qm.orange
WebSphere MQ queue manager created.
Creating or replacing default objects for qm.orange.
Default objects statistics : 40 created. 0 replaced. 0 failed.
Completing setup.
strmqm
WebSphere MQ queue manager 'qm.orange' starting.
5 log records accessed on queue manager 'qm.orange' during the log replay phase.
Log replay for queue manager 'qm.orange' complete.
Transaction manager state recovered for queue manager 'qm.orange'.
WebSphere MQ queue manager 'qm.orange' started.
You can see that since I used the -q switch the qm.orange queue manager is now the default queue manager and when I issue the strmqm command it is able to start the default queue manager. To start qm.apple I type strmqm qm.apple
strmqm qm.apple
WebSphere MQ queue manager 'qm.apple' starting.
5 log records accessed on queue manager 'qm.apple' during the log replay phase.
Log replay for queue manager 'qm.apple' complete.
Transaction manager state recovered for queue manager 'qm.apple'.
WebSphere MQ queue manager 'qm.apple' started.
We now have two queue managers. What we want to do now is create a queue to receive messages on qm.apple. Do do this we use the command line utility called MQSC. The command is runmqsc. It is a command line interpreter which executes MQ confirmation command to adjust MQ object settings. if we type runmqsc we will automatically start the MQSC tool for the default queue manager.
runmqsc qm.apple
runmqsc qm.apple
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.apple.
define qlocal(q1)
1 : define qlocal(q1)
AMQ8006: WebSphere MQ queue created.
end
2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
What we need to do now is create a listener for the qm.apple which allows our sending queue manager (qm.orange) to connect via channel. We are going to make the listener use port 30000. If you follow the link above which explains a listener you can learn what the default port is.
runmqsc qm.apple
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.orange.
define listener(qm.apple.listener) trptype(TCP) port(30000)
1 : define listener(qm.apple.listener) trptype(TCP) port(30000)
AMQ8626: WebSphere MQ listener created.
start listener(qm.apple.listener)
2 : start listener(qm.apple.listener)
AMQ8021: Request to start WebSphere MQ Listener accepted.
end
3 : end
2 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
What we are going to do now is create a listener for qm.orange. You may think, why do we need a listener for qm.orange when it is the sending queue manager? Well it is because to use MQ Explorer form a remote machine i.e. my windows machine to administer MA on my Linux box I will need to connect as a client to the queue managers via their listeners.
runmqsc qm.orange
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.orange.
define listener(qm.orange.listener) trptype(TCP) port(30001) ipaddr(192.168.0.60)
1 : define listener(qm.orange.listener) trptype(TCP) port(30001) ipaddr(192.168.0.60)
AMQ8626: WebSphere MQ listener created.
start listener(qm.orange.listener)
2 : start listener(qm.orange.listener)
AMQ8021: Request to start WebSphere MQ Listener accepted.
end
3 : end
2 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
You will notice in this listener I added the ipaddr parameter this is to show that you can see what ipaddress you wish to listen on. This is key for intercommunication. Remember firewalls will need to be configures if you have them to allow communication on these ports.
If we look at the running listener proceses.
ps -ef | grep runmqlsr
mqm 17609 17471 0 08:50 ? 00:00:00 /opt/mqm/bin/runmqlsr -r -m qm.orange -t TCP -p 30001 -i 192.168.0.60
mqm 17636 17526 0 08:56 ? 00:00:00 /opt/mqm/bin/runmqlsr -r -m qm.apple -t TCP -p 30000
You can see that MQ is running the command runmqlsr and the qm.apple listern is not bound to a specific ipaddress. What we will do not is alter the qm.apple listener.
runmqsc qm.apple
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.apple.
alter listener(qm.apple.listener) ipaddr(192.168.0.60)
1 : alter listener(qm.apple.listener) ipaddr(192.168.0.60)
AMQ8405: Syntax error detected at or near end of command segment below:-
alter listener(qm.apple.listener) ipaddr
AMQ8427: Valid syntax for the MQSC command:
ALTER LISTENER(listener_name)
TRPTYPE( TCP | SPX | NETBIOS | LU62 )
alter listener(qm.apple.listener) trptype(tcp) ipaddr(192.168.0.60)
2 : alter listener(qm.apple.listener) trptype(tcp) ipaddr(192.168.0.60)
AMQ8623: WebSphere MQ listener changed.
end
3 : end
2 MQSC commands read.
One command has a syntax error.
All valid MQSC commands were processed.
As you can see a typing mistake and so MQSC will prompt with an error to show some information to lead you in the right direction. Note that it doesn't always tell you all the command options in complete detail, this is something you will have to read in help documentation.
We will have to bounce the listener for the ipaddress parameter to take effect.
runmqsc qm.apple
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.apple.
stop listener(qm.apple.listener)
1 : stop listener(qm.apple.listener)
AMQ8706: Request to stop WebSphere MQ Listener accepted.
start listener(qm.apple.listener)
2 : start listener(qm.apple.listener)
AMQ8021: Request to start WebSphere MQ Listener accepted.
end
3 : end
2 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
OK we now have to running queue managers with appropriate listeners. What we need to do now is create a transmission queue on qm.orange. We require a transmission queue to be able to talk to a channel object. We use a channel to allow qm.orange to talk to qm.apple. We will also need to create a remote queue definition which will represent our remote queue q1 on qm.apple which we want to send messages to.
runmqsc qm.orange
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.orange.
define qlocal (qm.orange.tq) usage(xmitq)
1 : define qlocal (qm.orange.tq) usage(xmitq)
AMQ8006: WebSphere MQ queue created.
end
2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
runmqsc
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.orange.
define qremote(q1) rname(q1) rqmname(qm.apple) xmitq(qm.orange.tq)
1 : define qremote(q1) rname(q1) rqmname(qm.apple) xmitq(qm.orange.tq)
AMQ8006: WebSphere MQ queue created.
end
2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
We have created the transmission queue and and a remote queue definition, we still need to create the channel object, but before we do lets use MQ explorer to see what we have created.
Before we can actually look at the queue managers we need to ensue that MQ explorer can connect to the queue managers, to do this we need to ensure that both queue managers have special channel created called SYSTEM.ADMIN.SVRCONN.
The server-connection channel, called SYSTEM.ADMIN.SVRCONN, must exist on every remote queue manager you need to manage using MQ explorer i.e. remote to the machine where you are running MQ Explorer. This channel is mandatory for every remote queue manager being administered by WebSphere MQ Explorer. Without it, remote administration is not possible.
runmqsc qm.apple
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager qm.apple.
DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN)
1 : DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN)
AMQ8014: WebSphere MQ channel created.
start channel(SYSTEM.ADMIN.SVRCONN)
2 : start channel(SYSTEM.ADMIN.SVRCONN)
AMQ8018: Start WebSphere MQ channel accepted.
end
3 : end
2 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
Do the same for qm.orange. We can now connect to the queue managers. Run MQ Explorer. Remember in my example MQ explorer is running on my windows laptop where MQ is running on my remote Linux machine.
17 comments:
Thanks, this helped me a lot. I've only used local queues for testing before. The "Websphere MQ V6, Websphere Message Broker V6, and SSL" redpaper didn't explain it to me as well as this.
zolpidem half life max dosage zolpidem tartrate - buy zolpidem 10mg
buy valium valium pills look like - valium pills dose
generic ativan online what's normal dosage ativan - death from ativan and alcohol
ativan without prescription ativan withdrawal and depression - lorazepam 1mg para que serve
order ativan ativan overdose with alcohol - ativan dosage levels
can you sniff diazepam buy diazepam online from u.k - diazepam dosage tetanus
buy ativan lorazepam 1mg street value - ativan 321
online diazepam buy diazepam online usa no prescription - diazepam 5mg how often
buy soma online carisoprodol 350 mg withdrawal - fail drug test soma
buy carisoprodol somanabolic muscle maximizer user reviews - soma online order
buy ambien online ambien withdrawal itchy skin - ambien medication
soma price generic soma compound - carisoprodol 350 mg narcotic
ambien for sale no prescription ambien pill splitter - ambien dosage 6.25
buy valium cheap online generique du valium - valium anxiety relief
buy ambien online can buy ambien mexico - sleepwalking with ambien
buy valium online buy valium asia - how long does valium effects last
Post a Comment