Author |
Message
|
emaster |
Posted: Tue Apr 16, 2002 11:42 am Post subject: |
|
|
Novice
Joined: 15 Apr 2002 Posts: 10
|
I am new to MQSeries and java. I would like to know how you verify that the message id of the put matches the correlation id of the reply(get). I know that I am getting the correct message from the queue but is there a way to display both id's so I can it visually.
I am not sure how to convert the messageId and correlationId to a format that I can verify it - any help is appreciated.
|
|
Back to top |
|
 |
bduncan |
Posted: Tue Apr 16, 2002 1:20 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
If you want to visually look at the message and correl ids of your messages, I would recommend getting MQJExplorer, available at: http://www.kolban.com/mqjexplorer/
With this you can browse messages on the queues and look at their various properties...
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
StefanSievert |
Posted: Tue Apr 16, 2002 2:09 pm Post subject: |
|
|
 Partisan
Joined: 28 Oct 2001 Posts: 333 Location: San Francisco
|
Brandon,
I think Neil had to remove MQJExplorer from distribution so I guess it's no longer available.
Stefan
_________________ Stefan Sievert
IBM Certified * WebSphere MQ |
|
Back to top |
|
 |
emaster |
Posted: Tue Apr 16, 2002 4:50 pm Post subject: |
|
|
Novice
Joined: 15 Apr 2002 Posts: 10
|
Is there any way programmatically in a java application to view the id's? I would like to verify that the id's match before displaying the information in the get message to our customers. I can verify that some of the data matches (the account number in the put message should equal the get message) OR is this not really common practice. I have searched for an example but cannot seem to find any that actually displays the id's.
Thanks for any help in advance.
|
|
Back to top |
|
 |
emaster |
Posted: Wed Apr 17, 2002 9:57 am Post subject: |
|
|
Novice
Joined: 15 Apr 2002 Posts: 10
|
Thanks but I do not need a reply I was able to speak to an MQ Series expert and they provided me with my answer.
|
|
Back to top |
|
 |
mqonnet |
Posted: Wed Apr 17, 2002 10:08 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
You could always do a Browse get before doing a Destructive Get and to be more specific to your need, you could call a get with specific Msgid or Correl id. And only if you are satisfied that this is what you were expecting, you go ahead and get that message destructively.
Hope this helps.
Cheers.
Kumar
_________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
Back to top |
|
 |
bduncan |
Posted: Wed Apr 17, 2002 11:13 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
I'm just curious, but what exactly did this MQSeries Expert tell you to do?
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
emaster |
Posted: Wed Apr 17, 2002 12:12 pm Post subject: |
|
|
Novice
Joined: 15 Apr 2002 Posts: 10
|
He said that it is really not common practice to verify in my application that the messageID matches the correlationID after it is implemeted. He said once I know that my code is working it is overkill. He did recommend to use the ByteArrayInputStream. I did use that as shown below for both the messageId of the request and the correlationID of the reply and what was printed did match. If this does not seem correct, please let me know. I do know that I am retrieving the correct message but since I am new to MQseries and java, I wanted to see the actual id's as confirmation. Also, I do not have any MQSeries software loaded on my pc at this time so I can only work with the tools I found written in java. I am just trying to get a proof-of-concept application completed to present to our customer to determine if we should go forward.
ByteArrayInputStream outmsg = new ByteArrayInputStream(putmessage.messageId);
byte[] k1 = new byte[1024] ;
int outid = outmsg.read(k1,0,23);
for (int y1=0 ; y1 < 24; y1++)
System.out.print(k1[y1]) ;
ByteArrayInputStream in = new ByteArrayInputStream(getMessage.correlationId);
byte[] k = new byte[24] ;
int id = in.read(k,0,23);
for (int y=0 ; y < 24; y++)
System.out.print(k[y]) ;
|
|
Back to top |
|
 |
bduncan |
Posted: Wed Apr 17, 2002 4:39 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Yes, what he told you is valid. Once you know the application is functionally correct, there isn't a need to verify that the ids match. You can trust that the queue manager will give you the message with correl id 'xxx' if that's what you asked for.
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
|