Author |
Message
|
rsk33 |
Posted: Wed Sep 28, 2011 5:51 pm Post subject: looping in request flow and reply message flow |
|
|
Centurion
Joined: 21 Aug 2006 Posts: 141
|
I have a ESQL code which need to send request from request flow in a loop and receive the reply in response flow. Based on response field value i need to continue in the request flow.
I understand the loop counter i can store in shared row. But how i can make sure the flows are working in correct sequence while reading the data at the same time.
Any help is highly appreciated. |
|
Back to top |
|
 |
ruchir |
Posted: Wed Sep 28, 2011 10:08 pm Post subject: |
|
|
Guest
|
Hi,
I hope if you are not using multiple instances then the flow is synchronous and your flow will be in correct sequence. Hope it helps.
Or please tell more about your flow, how u r sending request back based on response flow. |
|
Back to top |
|
 |
rsk33 |
Posted: Wed Sep 28, 2011 11:40 pm Post subject: |
|
|
Centurion
Joined: 21 Aug 2006 Posts: 141
|
Hi ruchir,
Thanks for the response.
Is there any better alternate approch.
Regards |
|
Back to top |
|
 |
ruchir |
Posted: Thu Sep 29, 2011 12:18 am Post subject: |
|
|
Guest
|
Hi,
Plz tell more details abt your flow.
Quote: |
Based on response field value i need to continue in the request flow.
|
How u r achieving this in flow. Hope it can help to help u better. |
|
Back to top |
|
 |
rsk33 |
Posted: Thu Sep 29, 2011 12:30 am Post subject: |
|
|
Centurion
Joined: 21 Aug 2006 Posts: 141
|
i am still designing and not implemented as i am finding ways how to synchronise.
Regards. |
|
Back to top |
|
 |
zpat |
Posted: Thu Sep 29, 2011 12:40 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
If you are sharing a response queue, you must get your own response based on MQMD.correlid matching. Alternatively you might use a dynamic queue and set the queue name value in the MQMD.ReplytoQ field.
The application that generates the response message, should copy the incoming request MQMD.msgid to the outgoing response MQMD.correld. It should ideally respond to the queue named in MQMD.ReplytoQ field (if not set - default to the shared reply queue).
You will know your own request msgid value, so you can access your own reply message based on matching the correlid.
For request/reply inside one flow - choose sensible get wait time values and have the reply messages created with an expiry value, so if they are not accessed then they don't sit around on the queue forever.
A more classic WMB model is to the have the request flow terminate after generating the request message. Another flow processes the response messages. |
|
Back to top |
|
 |
rsk33 |
Posted: Thu Sep 29, 2011 1:23 am Post subject: |
|
|
Centurion
Joined: 21 Aug 2006 Posts: 141
|
Thanks for reply.
I do agree the classic design is request flow should terminate.
but my question is how to pass back to request flow once the reply is processed. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 29, 2011 1:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
rsk33 wrote: |
Thanks for reply.
I do agree the classic design is request flow should terminate.
but my question is how to pass back to request flow once the reply is processed. |
If you mean to correlate a request and a reply when the reply is in a different flow, look up the aggregation pattern.
Be aware that you can pass the relevant request data as just another member into the aggregation.
This should scale quite well.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ruchir |
Posted: Thu Sep 29, 2011 2:00 am Post subject: |
|
|
Guest
|
rsk33 wrote: |
how to pass back to request flow once the reply is processed. |
I think you can do it by again putting the data to the request flow input node queue. This way u can again start ur request flow depending on the response flow,  |
|
Back to top |
|
 |
zpat |
Posted: Thu Sep 29, 2011 2:43 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
"how to pass back". Wrong way to phrase it.
If you want a MQ call out inside one flow.
You send the request via a MQOutput node (transaction=NO).
You wait for the response with a MQGET node (matching correlid). |
|
Back to top |
|
 |
|