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 Message Broker (ACE) Support » Asyncronous correlationid

Post new topic  Reply to topic
 Asyncronous correlationid « View previous topic :: View next topic » 
Author Message
WMBSAM
PostPosted: Sun Oct 04, 2009 8:17 pm    Post subject: Asyncronous correlationid Reply with quote

Voyager

Joined: 02 Oct 2009
Posts: 90
Location: Atlanta

I have a situation where i receive the requests from 'n' number of different workstations thru HTTP request. so our design needs create a unique correl id depending upon the workstation URL and the messageid so that when i receive the response from the other webservice i send the resonse to the correct destination from where i received the request originated.

Any ideas how to implement it???

I thought to save the two parameters using the shared row variable but the problem is when i receive the response after tracking the end url to make the http call to the correct destination i need to delete that particular element in the main row variable and update the row variable.

It is an asynchronous flow.

My code looks something like this:
declare i shared int 0;
declare CorrelationID shared row;

Code:
IF InputRoot.XMLNSC.ns1:Envelope.ns2:Body.ns3:reqid= 'xxxx' THEN
while
 SET CorrelID.Data[] = list{HTTP.URL,Inputroot.reqid};   
   END;      ;   


and after i receive the response route to correct destination and then how to delete the correlationid.data[x] variable and update the row variable???
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Oct 04, 2009 9:32 pm    Post subject: Reply with quote

Grand High Poobah

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

I believe you're going down the path of wrong design...
Let MQ allocate the correlationId. It is an anonymous identifier pattern.
You don't need to know the correlationId and it does not have to have special meaning. All you need to be able to do is have it be unique (MQ will take care of that) and link it to your httreply (the flow should take care of that).

The rest here is from memory... so correct to the right variable name if I misspelled something...

Retrieve the correlid after the request message was written from
LocalInputEnvironment in a new compute node...-- read up on the MQPut node it will tell you exactly where the correlId goes on the LocalOutputEnvironment tree...

You can then retrieve the response by correlationID...

Hope this helps.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Sun Oct 04, 2009 10:46 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Right, but it's not apparent that there's any MQ involved at all.

Regardless, I was fairly sure that there should be a session id of some kind in the HTTP headers.
Back to top
View user's profile Send private message
Raj2000
PostPosted: Mon Oct 05, 2009 12:26 am    Post subject: Reply with quote

Apprentice

Joined: 03 Aug 2009
Posts: 47

Yes ,Jeff is correct there is no mq involved .i receive the input messages as http request from there i will capture the URL of the client application which made the req and the request id which is sent as a part of the input message i need to combine them to make a correl id in shared variable as follows:

CorrelID.Data[]=list{I/p Root.reqID,URL}

<CorreID>
<ReqID>abc</ReqID>
<URL>http://</URL>
</CorreID>
<CorreID>
<ReqID>xyz</ReqID>
<URL>http://</URL>
</CorreID>
....... and so on..

i can do the above task and wen i receive the response i would track the destination URL depending upon the reqid sent by the response and which is saved inthe row variable. but the problem is how to delete this particular correlid element and update the row variable so that no duplication takes place.I am stuck over here.

Any other suggestion(i mean logic which can accomplish the above task) is also welcome?

Back to top
View user's profile Send private message
Raj2000
PostPosted: Mon Oct 05, 2009 12:43 am    Post subject: Re: Asyncronous correlationid Reply with quote

Apprentice

Joined: 03 Aug 2009
Posts: 47

WMBSAM wrote:
our design needs create a unique correl id depending upon the workstation URL and the messageid so that


I am sorry it is not the message id it is the request id i receive as a part of the I/p message.

Quote:

My code looks something like this:
declare i shared int 0;
declare CorrelationID shared row;

Code:
IF InputRoot.XMLNSC.ns1:Envelope.ns2:Body.ns3:reqid= 'xxxx' THEN
while
 SET CorrelID.Data[] = list{HTTP.URL,Inputroot.reqid};   
   END;      ;   


and after i receive the response route to correct destination and then how to delete the correlationid.data[x] variable and update the row variable???


Update regarding the code:

Code:
declare i shared int 0;
declare CorrelationID shared row;
IF InputRoot.XMLNSC.ns1:Envelope.ns2:Body.ns3:reqid= 'xxxx' THEN
while
 SET CorrelID.Data[i] = list{HTTP.URL,Inputroot.reqid};
i=i+1;   
   END;      ;

and after i receive the response route to correct destination and then how to delete the correlationid.data[x] variable and update the row variable???
Back to top
View user's profile Send private message
WMBSAM
PostPosted: Mon Oct 05, 2009 10:25 am    Post subject: Reply with quote

Voyager

Joined: 02 Oct 2009
Posts: 90
Location: Atlanta

just thought to ask is there any way i can use Soap Asynchrnous request response node to acheive the above task if so how???
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Oct 05, 2009 7:46 pm    Post subject: Reply with quote

Grand High Poobah

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

OK so the problem is carrying the response information to the asynchronous reply...

I'd use the aggregation pattern and would just package the reply information into an additional MQ Message going to the aggregation. At fan in retrieve all messages and use the reply information to create your destination information, whether it be MQ or http....

If it is in the same flow... why don't you use the Environment tree for parking the information until you need it?

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Oct 06, 2009 2:10 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Or there should be a session ID in the original HTTP request that can be passed in the HTTP headers.

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 Message Broker (ACE) Support » Asyncronous correlationid
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.