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 Index » WebSphere Process Server (WID/WPS/WAS+) » Asynch invoke using MQ Binding : How to get MsgId ?

Post new topic  Reply to topic
 Asynch invoke using MQ Binding : How to get MsgId ? « View previous topic :: View next topic » 
Which approach is suggested?
Sol-1
0%
 0%  [ 0 ]
Sol-2
100%
 100%  [ 2 ]
Other (please explain in comment)
0%
 0%  [ 0 ]
Total Votes : 2
Author Message
satya.sid
PostPosted: Thu Dec 02, 2010 10:52 am    Post subject: Asynch invoke using MQ Binding : How to get MsgId ? Reply with quote

Novice

Joined: 14 Jan 2009
Posts: 15

I have an intersting problem which initially thought would be simple. It goes like tis.

Step-1: Process-1 invokes a service in Asynch manner over XML/MQ.
Step-2: Process-1 then store the MQ MsgId in database.
Step-3: Process-2 will pick the resopnse msg. The request msgid is used as the correlation id.
Step-4: Process-2 will update the response msg to database using the correlation id.

Its looks quiete simple but stuck with below points.

Sol-1. If process-1 invokes in Asynch manner , how it can get the MQ MsgId and store in database.
Sol-2. Process-1 could generate the MsgId in process and populate in the MsgId element (smo/headers/MQHeader/md/MsgId) in Request message. But every time it sets and once sent to MQ queue, its overwritten by the QueueManager generated MsgId.

Did anyone solved similar issue. Any help would be much appreciated.

Regards
Satya
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Dec 03, 2010 12:45 am    Post subject: Reply with quote

Grand High Poobah

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

Well before step 1 finishes and after the message was sent you need to retrieve the messageId from the sent message as long as it is still in scope.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
JLRowe
PostPosted: Fri Dec 03, 2010 5:26 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

SCA should deal with this kind of stuff, correlation of requests and replies. Your code should be agnostic to the transport mechanism underneath, that's the whole point of SCA!
Back to top
View user's profile Send private message Send e-mail
satya.sid
PostPosted: Sat Dec 18, 2010 5:52 pm    Post subject: Resolved Reply with quote

Novice

Joined: 14 Jan 2009
Posts: 15

Hi All

Finally its resolved by the Sol-2 aproach...

Below two points you have to take care if you want MsgId to be generated & set from the Application and then send the msg to Queue.

1. First make sure in the MQ import -> Proporties -> Binding -> Message Confirguration -> Request Message Id option -: "Copy from SCA message".

2. Make sure you are assigning a correct MsgId and in correct manner.
2.1 MsgId should be 48 char HexDecimal String (so that it accomodates in MQBYTE24).
2.2 If using XSLT to assign the MsgId then can do string assignment or custom Java where the method returns correct string format MsgId.
2.3 If using java snippet in custom mediation then may use as below.
Code:
smo.setBytes("headers/MQHeader/md/MsgId",MyAppJavaUtil.getMsgIdBytes());
or
smo.setString("headers/MQHeader/md/MsgId",MyAppJavaUtil.getMsgIdString());
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Process Server (WID/WPS/WAS+) » Asynch invoke using MQ Binding : How to get MsgId ?
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.