Author |
Message
|
Yavor |
Posted: Wed Mar 08, 2006 6:04 am Post subject: remote queues |
|
|
Novice
Joined: 08 Mar 2006 Posts: 12
|
Hi all,
First, please excuse my English, I am not native speaker. Thank you.
Second, please excuse me if I am asking something already answered 1000 times and perhaps even asking it in wrong place. But I am in a hurry. And after a day googling, reading manuals etc I am still not able to solve my problem. Thank you.
Now to the point.
I have two servers lets name them SERVER_ONE and SERVER_TWO. On SERVER_ONE I have queue manager QM1 and a local queue TEST. I can put messages from SERVER_TWO to TEST on SERVER_ONE using MQSERVER variable (forgot to say both servers are *nix). What I need to do is to have a queue on SERVER_TWO to witch local apps could connect but this queue should send messages to a queue on SERVER_ONE. As far as I understand from reading I should create remote queues on both servers and sender and receiver channels. But no matter how I try I fail to make it work. Can you please tell my what exactly the configuration on both channels should look like and both remote queues too? That is, if I am right that this is the way to do the job - 2 remote queues and sender and reciever channels. If not, how can I accomplish this?
Thank you in advance. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Mar 08, 2006 6:17 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need, oddly enough, six queues in order to get a full bi-directional communication like you want.
On Server1, you need the following three queues (names are examples)
SVR1_INPUT - a queue local
SVR2 - a qlocal marked as having XMITQ usage
SVR2_INPUT - a queue remote
You need a complementary set of three queues on Server2.
SVR2_INPUT - a qlocal (and pointed to by the qremote on server1 of the same name)
SVR1 - a qlocal marked as having XMITQ usage
SVR1_INPUT - a qremote, pointing to SVR1_INPUT
Then you need a pair of sender and receiver channels matched on each qmgr, for example SVR1_TO_SVR2 is a sender channel on SVR1 and a receiver on SVR2 (and uses SVR2 as it's XMITQ). Likewise SVR2_TO_SVR1 would be a sender and receiver the other way.
Then you can put messages to SVR1_INPUT on Server2, and get them from SVR1_INPUT on Server2. And you can put messages to SVR2_INPUT on Server1, and get them from the SVR2_INPUT on Server2.
You can never GET messages from anything that is not a QLOCAL. So you can never get from SVR1_INPUT on Server2. And you never want to GET or PUT directly to XMITQs. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Yavor |
Posted: Wed Mar 08, 2006 6:28 am Post subject: Thank you very much, jefflowrey! |
|
|
Novice
Joined: 08 Mar 2006 Posts: 12
|
Thank you very much indeed!
I am pretty ignorant of mqseries. Once, three or more years ago I managed to start that qumanagers and queues for developers here (after spending 3.5
days in reading pdfs with odd names like amqzag01.pdf, amqzao03.pdf, csqzaf05.pdf and csqzae06.pdf) but never since I dived into mqsc.
I am able to read but unable to write console commands so to speak. Well I write much but errors are even more . So, I will be very grateful if you could be more specific on define channel (chltype trptype etc) and define qlocal and qremote. Extremely grateful I must say! You can use whatever names for CHANNELS and QUEUES you see fit or otherwise like. Thank you very much once again.
BR,
Yavor |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Mar 08, 2006 6:34 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I can't be more specific about TRPTYPE, because that depends entirely on your network - are you using TCP/IP (Ethernet)? Likewise, I can't be specific about CONNAME, because againt it depends on your network.
If you are having trouble understanding the documentation, if you can post a specific piece, and ask a question - then we can help.
There has been a recent posting here in the last week or so from someone else trying to get this basic setup done - and they ended it up I think with specific steps. So if you search for it, you should find help there too. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Yavor |
Posted: Wed Mar 08, 2006 6:48 am Post subject: OK, 10x |
|
|
Novice
Joined: 08 Mar 2006 Posts: 12
|
I will search here and try your suggestions. If I run into problems I will post specific info here if that is OK. And yes I use TCP/IP. I can create new qmanagers and add queues and channels to them. Anyway, thank you very much! |
|
Back to top |
|
 |
skycoolers |
Posted: Wed Mar 08, 2006 10:59 am Post subject: |
|
|
 Apprentice
Joined: 22 Dec 2005 Posts: 35
|
I published a message successfully to a remote queue. Is there any way to browse the RemoteQ remotely? Sorry for confusing you, actually I want to consume the message that I published to the remote system for my local server. |
|
Back to top |
|
 |
EddieA |
Posted: Wed Mar 08, 2006 12:36 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
Is there any way to browse the RemoteQ remotely |
No.
You can only read messages from a queue that is local to the QM your application is connected to.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
Yavor |
Posted: Thu Mar 09, 2006 1:48 am Post subject: Here is what I cooked, but not eatable (again :) |
|
|
Novice
Joined: 08 Mar 2006 Posts: 12
|
SVR1 is LTS
SVR2 is MCLRN
On LTS I did this
$crtmqm -q LTS
WebSphere MQ queue manager created.
Creating or replacing default objects for LTS.
Default objects statistics : 31 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
$strmqm LTS
WebSphere MQ queue manager 'LTS' started.
$runmqlsr -t tcp -m LTS&
$dspmq
....
QMNAME(LTS) STATUS(Running)
$runmqsc LTS
Starting WebSphere MQ script Commands.
define qlocal(LTS_INPUT)
1 : define qlocal(LTS_INPUT)
AMQ8006: WebSphere MQ queue created.
define qlocal(MCL) usage(XMITQ)
2 : define qlocal(MCL) usage(XMITQ)
AMQ8006: WebSphere MQ queue created.
3 : define qremote(MCL_INPUT) rqmname(MCLRN) rname(MCLRN_INPUT)
AMQ8006: WebSphere MQ queue created.
4 : define channel(LTS_TO_MCLRN) chltype(SDR) trptype(TCP) conname(MCLRN) XMITQ(MCLRN_INPUT)
AMQ8014: WebSphere MQ channel created.
5 : define channel(MCLRN_TO_LTS) chltype(RCVR) trptype(TCP)
AMQ8014: WebSphere MQ channel created.
On MCLRN I did this
$ crtmqm MCLRN
WebSphere MQ queue manager created.
Creating or replacing default objects for MCLRN.
Default objects statistics : 31 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
$ strmqm MCLRN
WebSphere MQ queue manager 'MCLRN' started.
$ runmqlsr -t tcp -m MCLRN&
$ dspmq
....
QMNAME(MCLRN) STATUS(Running)
$ runmqsc MCLRN
Starting MQSC for queue manager MCLRN.
define qlocal(MCLRN_INPUT)
1 : define qlocal(MCLRN_INPUT)
AMQ8006: WebSphere MQ queue created.
define qlocal(MCLRN) usage(XMITQ)
2 : define qlocal(MCLRN) usage(XMITQ)
AMQ8006: WebSphere MQ queue created.
define qremote(LTS_INPUT) rqmname(LTS) rname(LTS_INPUT)
3 : define qremote(LTS_INPUT) rqmname(LTS) rname(LTS_INPUT)
AMQ8006: WebSphere MQ queue created.
define channel(MCLRN_TO_LTS) chltype(SDR) trptype(TCP) conname(LTS) XMITQ(LTS_INPUT)
4 : define channel(MCLRN_TO_LTS) chltype(SDR) trptype(TCP) conname(LTS) XMITQ(LTS_INPUT)
AMQ8014: WebSphere MQ channel created.
define channel(LTS_TO_MCLRN) chltype(RCVR) trptype(TCP)
5 : define channel(LTS_TO_MCLRN) chltype(RCVR) trptype(TCP)
AMQ8014: WebSphere MQ channel created.
And then I end up with error messages like this
$ ./amqscnxc -x srv2
Sample AMQSCNXC start
Connecting to the default queue manager
using the server connection channel SYSTEM.DEF.SVRCONN
on connection name srv2.
Connection established to queue manager MCLRN
Sample AMQSCNXC end
$ ./amqsputc LTS_INPUT MCLRN
Sample AMQSPUT0 start
MQCONN ended with reason code 2059
$ ./amqsputc LTS MCLRN
Sample AMQSPUT0 start
MQCONN ended with reason code 2059
I guess I messed up XMITQ settings.
BR,
Yavor |
|
Back to top |
|
 |
Yavor |
Posted: Thu Mar 09, 2006 2:03 am Post subject: hmmm I saw some errors in names |
|
|
Novice
Joined: 08 Mar 2006 Posts: 12
|
going to correct that and see
also in connection attempts
mea culpa |
|
Back to top |
|
 |
Yavor |
Posted: Thu Mar 09, 2006 3:33 am Post subject: corrections made alas to no avail |
|
|
Novice
Joined: 08 Mar 2006 Posts: 12
|
after reading this post
http://mqseries.net/phpBB/viewtopic.php?t=21202&highlight=qremote&sid=ece140959b881489968ad6c3291b203c
I've made following corrections to my setup:
on svr1(192.168.1.1)
$crtmqm LTS
WebSphere MQ queue manager created.
Creating or replacing default objects for LTS.
Default objects statistics : 31 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
$strmqm LTS
WebSphere MQ queue manager 'LTS' started.
$runmqlsr -t tcp -m LTS&
$dspmq
....
QMNAME(LTS) STATUS(Running)
$runmqsc LTS
Starting WebSphere MQ script Commands.
define qlocal(LTS_INPUT)
1 : define qlocal(LTS_INPUT)
AMQ8006: WebSphere MQ queue created.
define qlocal(MCLRN) usage(XMITQ)
2 : define qlocal(MCLRN) usage(XMITQ)
AMQ8006: WebSphere MQ queue created.
define channel(LTS_TO_MCLRN) chltype(sdr) trptype(tcp) conname('192.168.1.2') xmitq(MCLRN)
3 : define channel(LTS_TO_MCLRN) chltype(sdr) trptype(tcp) conname('192.168.1.2') xmitq(MCLRN)
AMQ8014: WebSphere MQ channel created.
define channel(MCLRN_TO_LTS) chltype(rcvr) trptype(tcp)
4 : define channel(MCLRN_TO_LTS) chltype(rcvr) trptype(tcp)
AMQ8014: WebSphere MQ channel created.
define qremote(MCLRN_INPUT) rname(LTS_INPUT) rqmname(MCLRN) xmitq(MCLRN)
5 : define qremote(MCLRN_INPUT) rname(LTS_INPUT) rqmname(MCLRN) xmitq(MCLRN)
AMQ8006: WebSphere MQ queue created.
on svr2(192.168.1.2)
$ crtmqm MCLRN
WebSphere MQ queue manager created.
Creating or replacing default objects for MCLRN.
Default objects statistics : 31 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
$ strmqm MCLRN
WebSphere MQ queue manager 'MCLRN' started.
$ runmqlsr -m MCLRN -t tcp
$ dspmq
...
QMNAME(MCLRN) STATUS(Running)
$ runmqsc MCLRN
Starting MQSC for queue manager MCLRN.
define qlocal(MCLRN_INPUT)
1 : define qlocal(MCLRN_INPUT)
AMQ8006: WebSphere MQ queue created.
define qlocal(LTS) usage(XMITQ)
2 : define qlocal(LTS) usage(XMITQ)
AMQ8006: WebSphere MQ queue created.
define channel(MCLRN_TO_LTS) chltype(sdr) trptype(tcp) conname('192.168.1.1') xmitq(LTS)
3 : define channel(MCLRN_TO_LTS) chltype(sdr) trptype(tcp) conname('192.168.1.1') xmitq(LTS)
AMQ8014: WebSphere MQ channel created.
define channel(LTS_TO_MCLRN) chltype(rcvr) trptype(tcp)
4 : define channel(LTS_TO_MCLRN) chltype(rcvr) trptype(tcp)
AMQ8014: WebSphere MQ channel created.
define qremote(LTS_INPUT) rname(MCLRN_INPUT) rqmname(LTS) xmitq(LTS)
5 : define qremote(LTS_INPUT) rname(MCLRN_INPUT) rqmname(LTS) xmitq(LTS)
AMQ8006: WebSphere MQ queue created.
both channels on both servers are started and I get following responce from ping channel command:
ping channel(MCLRN_TO_LTS)
AMQ8020: Ping WebSphere MQ channel complete.
ping channel(LTS_TO_MCLRN)
AMQ8020: Ping WebSphere MQ channel complete.
And then:
on srv2
$ ./amqsput LTS_INPUT MCLRN
Sample AMQSPUT0 start
target queue is LTS_INPUT
test
remote
queue
messaging
end of message
Sample AMQSPUT0 end
on srv1
./amqsget LTS_INPUT LTS
Sample AMQSGET0 start
no more messages
Sample AMQSGET0 end
and vice versa (put on srv1 and get on srv2) is exactly the same
any suggestions?
thank you in advance |
|
Back to top |
|
 |
wschutz |
Posted: Thu Mar 09, 2006 3:50 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
you might have started them, but that doen't mean they are running... when first testing channel I like to run them in the forground so I can see any error messages:
Code: |
runmqchl -m qmgr -c channel
|
also, check the depth on your xmit queue...
also, since you're taking the defualts, your messages are non-persistent and your channel have npmspeed(fast) which means the channel agent will discard the message if it can't be delivered... so change your remote queue def to "defpsist(yes)" and define a dead letter queue on yor qmgrs:
Code: |
alter qmgr deadq(system.dead.letter.queue) |
then try your test and check for messages on the dlq.... _________________ -wayne |
|
Back to top |
|
 |
Yavor |
Posted: Thu Mar 09, 2006 4:47 am Post subject: altering settings |
|
|
Novice
Joined: 08 Mar 2006 Posts: 12
|
at srv2 side
alter qmgr deadq(system.dead.letter.queue)
2 : alter qmgr deadq(system.dead.letter.queue)
AMQ8005: WebSphere MQ queue manager changed.
alter qr(LTS_INPUT) defpsist(yes)
3 : alter qr(LTS_INPUT) defpsist(yes)
AMQ8008: WebSphere MQ queue changed.
stop channel(MCLRN_TO_LTS)
4 : stop channel(MCLRN_TO_LTS)
AMQ8019: Stop WebSphere MQ channel accepted.
$ runmqchl -m MCLRN -c MCLRN_TO_LTS
03/09/06 14:29:44 Channel program started.
[4]+ Stopped runmqchl -m MCLRN -c MCLRN_TO_LTS
$ bg
same at srv1
$runmqsc LTS
Starting WebSphere MQ script Commands.
alter qmgr deadq(system.dead.letter.queue)
1 : alter qmgr deadq(system.dead.letter.queue)
AMQ8005: WebSphere MQ queue manager changed.
alter qr(MCLRN_INPUT) defpsist(yes)
2 : alter qr(MCLRN_INPUT) defpsist(yes)
AMQ8008: WebSphere MQ queue changed.
stop channel(LTS_TO_MCLRN)
3 : stop channel(LTS_TO_MCLRN)
AMQ8019: Stop WebSphere MQ channel accepted.
end
4 : end
3 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
$runmqchl -m LTS -c LTS_TO_MCLRN
03/09/06 14:34:49 Channel program started.
^Z
[2]+ Stopped runmqchl -m LTS -c LTS_TO_MCLRN
$bg
then I get this
$ ./amqsput LTS_INPUT MCLRN
Sample AMQSPUT0 start
target queue is LTS_INPUT
test
remote
queue
delivery
end of the message
Sample AMQSPUT0 end
$./amqsget LTS_INPUT LTS
Sample AMQSGET0 start
no more messages
Sample AMQSGET0 end
Where I can read logs for lost messages?
TIA |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 09, 2006 5:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
At the risk of demonstrating how thick I am, why are you stopping the channels? This is not going to help with messages flowing across them?
Given all that, did you check for messages on the dlq & xmit q as wschutz suggested? Are there any messages there? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Yavor |
Posted: Thu Mar 09, 2006 5:04 am Post subject: |
|
|
Novice
Joined: 08 Mar 2006 Posts: 12
|
Vitor wrote: |
At the risk of demonstrating how thick I am, why are you stopping the channels? This is not going to help with messages flowing across them?
Given all that, did you check for messages on the dlq & xmit q as wschutz suggested? Are there any messages there? |
I stopped them in order to run them from *nix CLI not from MQSC console. Can I run them twice? Once from within MQSC and once from outside?
On the other question:
How do I do that - check dlg & xmitq - from MQSC console or otherwise?
BR |
|
Back to top |
|
 |
Yavor |
Posted: Thu Mar 09, 2006 5:24 am Post subject: |
|
|
Novice
Joined: 08 Mar 2006 Posts: 12
|
stupid I am eh
but here is the output
$ ./amqsget xmitq MCLRN
Sample AMQSGET0 start
MQOPEN ended with reason code 2085
unable to open queue for input
Sample AMQSGET0 end
$ ./amqsget dlq MCLRN
Sample AMQSGET0 start
MQOPEN ended with reason code 2085
unable to open queue for input
Sample AMQSGET0 end
same on the other side |
|
Back to top |
|
 |
|