ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexIBM MQ Java / JMSDid anyone work with such configuration? Need help

Post new topicReply to topic
Did anyone work with such configuration? Need help View previous topic :: View next topic
Author Message
BDB
PostPosted: Wed Feb 18, 2009 4:50 pm Post subject: Did anyone work with such configuration? Need help Reply with quote

Apprentice

Joined: 06 Jan 2009
Posts: 28

I have tested my prototype succesfully with one weblogic server bridged to a MQ server on another machine via a binding file. I am able to send message to the MQ and also recieve the result. The weblogic bridge pulls any message it finds on the MQ reply queue. All good so far.

My problem is stated below:

If there are multiple weblogic instances on 2 different machines, how would this work?

Eg:

There are 2 load balanced linux boxes and each box having 3 instances of weblogic.

Box 1
=====
Instance 1
Instance 2
Instance 3


Box 2
======
Instance 4
Instance 5
Instance 6


Now every instance would have the weblogic bridge pulling message from the MQ Reply queue.

If a user(Box1, Instance1) send a request and expecting a reply back, it is quite possible that he will not recieve the message since someother weblogic instance (Box2, Instance 1) bridge has already pulled the message.

How do I solve this issue? Is there any solution to this?
I have Message Selectors set on consumers but that wont help since it works only on the local JMS queue where the message has already been pulled via bridge?

Is there any message selection trick based on bridge level so that bridge itself does not pull message that do that belong to it?




Help !!!
-BDB
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Feb 18, 2009 8:53 pm Post subject: Re: Did anyone work with such configuration? Need help Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

BDB wrote:
I have tested my prototype succesfully with one weblogic server bridged to a MQ server on another machine via a binding file. I am able to send message to the MQ and also recieve the result. The weblogic bridge pulls any message it finds on the MQ reply queue. All good so far.

Nothing good so far. I can send an entirely uncorrelated message to the queue and you are going to pick it up as answer to something completely unrelated. You are really looking here for a request reply scenario and need to implement it correctly.

BDB wrote:
My problem is stated below:

If there are multiple weblogic instances on 2 different machines, how would this work?

Eg:

There are 2 load balanced linux boxes and each box having 3 instances of weblogic.

Box 1
=====
Instance 1
Instance 2
Instance 3


Box 2
======
Instance 4
Instance 5
Instance 6


Now every instance would have the weblogic bridge pulling message from the MQ Reply queue.

If a user(Box1, Instance1) send a request and expecting a reply back, it is quite possible that he will not recieve the message since someother weblogic instance (Box2, Instance 1) bridge has already pulled the message.

How do I solve this issue? Is there any solution to this?
I have Message Selectors set on consumers but that wont help since it works only on the local JMS queue where the message has already been pulled via bridge?

Is there any message selection trick based on bridge level so that bridge itself does not pull message that do that belong to it?




Help !!!
-BDB

The answer is very simple and participates in the anonymous identifier pattern. The messaging pattern is request / reply.

Read documentation, look at exemples and when you have more questions get back to us...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
BDB
PostPosted: Thu Feb 19, 2009 5:19 am Post subject: Reply with quote

Apprentice

Joined: 06 Jan 2009
Posts: 28

Ahh..I forgot to add that My example that is working is based on Request/Reply pattern. May be my message selector expression is not setup correctly. I will fix it and get back to you if I face any issues.

Thanks for the reply.
Back to top
View user's profile Send private message
BDB
PostPosted: Fri Feb 20, 2009 6:50 pm Post subject: Reply with quote

Apprentice

Joined: 06 Jan 2009
Posts: 28

In the above Request/Reply example I am facing issue correlating the messages. When I don't specify MessageSelector, I can get the message but when I specify selector as "JMSCorrelationID = 'valueofcorrelation", it just keeps waiting. I checked the response message in MQ response queue, the correlation field shows correct value as in selector but in byte format.

I am missing something out here.

Any ideas? I did a search in this forum and found similar posts but nothing solved it for me.

Any help is appreciated.

-BDB
Back to top
View user's profile Send private message
BDB
PostPosted: Fri Feb 20, 2009 7:00 pm Post subject: Reply with quote

Apprentice

Joined: 06 Jan 2009
Posts: 28

I think I got a clue ..CorrelExample.java that says



http://www-304.ibm.com/jct01005c/isv/tech/sample_code/mq/CorrelExample.java
Quote:
c) legacy -> JMS. When the correlation ID originates in some other way */
/* than by copying the sent message, we have to construct a selector as a */
/* hex string prefixed by ID:



Am I right with this?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Feb 21, 2009 9:32 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

BDB wrote:
I think I got a clue ..CorrelExample.java that says



http://www-304.ibm.com/jct01005c/isv/tech/sample_code/mq/CorrelExample.java
Quote:
c) legacy -> JMS. When the correlation ID originates in some other way */
/* than by copying the sent message, we have to construct a selector as a */
/* hex string prefixed by ID:



Am I right with this?

You are correct and this will speed up the search. However you also need to be aware that if you do not use the JMSHeader (RFH) your correlationID is limited to the first 24 bytes of whatever you may have copied/set. Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
BDB
PostPosted: Mon Feb 23, 2009 11:05 am Post subject: Reply with quote

Apprentice

Joined: 06 Jan 2009
Posts: 28

Ok... I could successfully fix my issue and I am able to successfully fetch my response. I have one question.

Currently I am simulating a response sent by MQ server installed on my local machine. To do this, I wrote a simple Java program using MQ base classes to read from request queue, copy the data from Request Object to manually created response object and send the response to the back to the reply queue. . The problem is the response object also contains header information. How do I remove that and only pass back the actual data?

I see the following when I browse the response object in the MQ explorer.


00000 52 46 48 20 00 00 00 02--00 00 00 CC 00 00 01 11 |RFH........Ì....|
00010 00 00 04 B8 20 20 20 20--20 20 20 20 00 00 00 00 |................|
00020 00 00 04 B8 00 00 00 20--3C 6D 63 64 3E 3C 4D 73 |.........mcd..Ms|
00030 64 3E 6A 6D 73 5F 62 79--74 65 73 3C 2F 4D 73 64 |d.jms.bytes..Msd|
00040 3E 3C 2F 6D 63 64 3E 20--00 00 00 80 3C 6A 6D 73 |...mcd.......jms|
00050 3E 3C 44 73 74 3E 71 75--65 75 65 3A 2F 2F 4D 51 |..Dst.queue...MQ|
00060 54 65 73 74 2F 4D 51 52--65 71 75 65 73 74 51 75 |Test.MQRequestQu|
00070 65 75 65 3C 2F 44 73 74--3E 3C 52 74 6F 3E 71 75 |eue..Dst..Rto.qu|
00080 65 75 65 3A 2F 2F 4D 51--54 65 73 74 2F 4D 51 52 |eue...MQTest.MQR|
00090 65 73 70 6F 6E 73 65 51--75 65 75 65 3C 2F 52 74 |esponseQueue..Rt|
000A0 6F 3E 3C 54 6D 73 3E 31--32 33 35 34 31 35 34 39 |o..Tms.123541549|
000B0 31 32 31 39 3C 2F 54 6D--73 3E 3C 44 6C 76 3E 32 |1219..Tms..Dlv.2|
000C0 3C 2F 44 6C 76 3E 3C 2F--6A 6D 73 3E C1 C1 C2 C2 |..Dlv...jms.ÁÁÂÂ|
000D0 C2 C3 C3 C3 C4 C4 C4 C4--C5 C5 C5 C5 C5 C5 C5 C5 |ÂÃÃÃÄÄÄÄÅÅÅÅÅÅÅÅ|
000E0 C5 C5 C5 C5 C5 C5 F1 F2--F3 F4 F5 F6 F7 F8 F1 F2 |ÅÅÅÅÅÅñòóôõö.øñò|
000F0 F3 F4 F1 F2 F3 F4 C6 C7--C8 12 34 56 78 90 12 34 |óôñòóôÆÇÈ.4Vx..4|
00100 5C 12 34 56 78 90 12 34--5C 12 34 56 78 9C 12 34 |..4Vx..4..4Vx..4|
00110 56 78 9C C9 C9 C9 C9 C9--C9 C9 C9 D1 D1 D1 D1 D1 |Vx.ÉÉÉÉÉÉÉÉÑÑÑÑÑ|
00120 D1 D1 D1 D2 D2 40 40 40--40 40 40 40 40 40 40 40 |ÑÑÑÒÒ...........|
00130 40 40 40 40 40 40 40 40--40 40 40 40 40 40 40 40 |................|
00140 40 40 40 40 40 40 40 40--40 40 40 40 40 40 40 40 |................|
00150 40 40 40 40 40 40 40 40--40 40 40 40 40 40 40 40 |................|
00160 40 40 40 40 40 40 40 40--40 40 40 |........... |
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Feb 23, 2009 12:15 pm Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

BDB wrote:
The problem is the response object also contains header information. How do I remove that and only pass back the actual data?


Ok, it does contain only contain data. WMQ treats everything that isn't the MQMD as payload; hence the RFH2 is part of the payload as far as MQExplorer is concerned.

Secondly, if you've got JMS anywhere in the mix you'll need an RFH2 to hold the jms information.

So if you really don't want this information, make sure any JMS code is set to not produce it. Or use JMS/XMS throughout.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
BDB
PostPosted: Mon Feb 23, 2009 12:36 pm Post subject: Reply with quote

Apprentice

Joined: 06 Jan 2009
Posts: 28

Vitor wrote:
BDB wrote:
The problem is the response object also contains header information. How do I remove that and only pass back the actual data?


Ok, it does contain only contain data. WMQ treats everything that isn't the MQMD as payload; hence the RFH2 is part of the payload as far as MQExplorer is concerned.

Secondly, if you've got JMS anywhere in the mix you'll need an RFH2 to hold the jms information.

So if you really don't want this information, make sure any JMS code is set to not produce it. Or use JMS/XMS throughout.


Cool.. Thanks Vitor. I fixed this issue. I am using MessageProducer and MessageConsumer for my Request/Reply implementation so I was not able to usesolutions like setTargetclient, etc. I updated my binding file using JMSAdmin tool and used targclient(MQ) while defining Queues and that took care of it.



Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSDid anyone work with such configuration? Need help
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.