Author |
Message
|
Sriharsha |
Posted: Mon Oct 08, 2007 10:06 am Post subject: Handle Single Request - Multiple responses in Message Broker |
|
|
Novice
Joined: 20 Feb 2006 Posts: 13
|
Hi,
We have a situation in which for each single request sent to the backend from a message flow we might get 1 or 2 reply messages from the backend depending on the request message but we have to send only one reply message to the frontend application.
I read about aggregation nodes and looks like they can be used only if single request is fanned out into multiple requests in the request message flow and then responses for each of the fanned out request are aggregated in the reply flow. Can they be used even if a single request goes out in the request message flow but yields multiple responses in the reply ?
If not aggregation nodes i am thinking of using DB to cache and aggregate the multiple replies in the reply flow. Please let me know if you know any better solution than using DB |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Oct 08, 2007 10:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Use an MQGet node to fetch the reply or replies. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
TonyD |
Posted: Mon Oct 08, 2007 11:32 am Post subject: |
|
|
Knight
Joined: 15 May 2001 Posts: 540 Location: New Zealand
|
Quote: |
If not aggregation nodes i am thinking of using DB to cache and aggregate the multiple replies in the reply flow. Please let me know if you know any better solution than using DB
|
As Jeff said, MQGet will handle the multiple replies; you will need to have a way of knowing when you have received the last response, so that you can then go ahead and prepare the single response to the original requester. DB is unnecessary ... you should be able to accumulate the responses in the 'Environment' or in a ROW variable. |
|
Back to top |
|
 |
Sriharsha |
Posted: Mon Oct 08, 2007 12:43 pm Post subject: |
|
|
Novice
Joined: 20 Feb 2006 Posts: 13
|
Yes we have a tag in the reply message by which we can decide if it's the last response in the series of replies.
I will try using MQGet node and join both the replies together.
Thanks for your help.. |
|
Back to top |
|
 |
TonyD |
Posted: Mon Oct 08, 2007 12:59 pm Post subject: |
|
|
Knight
Joined: 15 May 2001 Posts: 540 Location: New Zealand
|
You will need to use a PROPAGATE loop to drive the MQGet node multiple times. Following a successful GET you can store the resulting message conyent in an array before control is passed back to the next MQGet. |
|
Back to top |
|
 |
Sriharsha |
Posted: Mon Oct 08, 2007 1:07 pm Post subject: |
|
|
Novice
Joined: 20 Feb 2006 Posts: 13
|
We get only 2 replies at the maximum. Then i guess i just have to store the first reply in the queue. When the last or 2nd reply comes pass it onto the MQGet node which takes the first reply from the queue and joins both of them right? |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Oct 08, 2007 1:25 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No.
You can just run the MQGet twice, once for the original reply and once for the second one.
If you configure it correctly, the node will store the data of both responses in different places (for example, by using Environment or a ROW variable as mentioned by TonyD). Then you can write ESQL to read from those two places, and build your response. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
EddieA |
Posted: Tue Oct 09, 2007 7:52 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Just remember that the MQGet node cannot read the same Queue as the MQInput.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
Vitor |
Posted: Tue Oct 09, 2007 8:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
|
Back to top |
|
 |
Bill.Matthews |
Posted: Tue Oct 09, 2007 9:36 am Post subject: |
|
|
 Master
Joined: 23 Sep 2003 Posts: 232 Location: IBM (Retired)
|
In the referenced post, EddieA also said that the restriction may be lifted in a future release...
Well, that future release is WebSphere Message Broker V6.1 (ega Nov 22, 2007) and the restriction will be removed (I asked the specific question).
Cheers _________________ Bill Matthews |
|
Back to top |
|
 |
Swathi3 |
Posted: Mon Jun 10, 2013 11:50 pm Post subject: Handle Single Request - Multiple responses in Message Broker |
|
|
Newbie
Joined: 10 Jun 2013 Posts: 2
|
Hi,
We have a situation in which for each single request sent to the backend from a message flow we might get 10 or 14 reply messages from the backend depending on the request message but we have to send only one reply message to the frontend application. Also, we have a tag in the reply message by which we can decide if it's the last response in the series of replies. Can we use MQGET node for this? If yes, can someone clearly explain how to achive this using get message by corellation id? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Jun 11, 2013 3:17 am Post subject: Re: Handle Single Request - Multiple responses in Message Br |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Swathi3 wrote: |
Hi,
We have a situation in which for each single request sent to the backend from a message flow we might get 10 or 14 reply messages from the backend depending on the request message but we have to send only one reply message to the frontend application. Also, we have a tag in the reply message by which we can decide if it's the last response in the series of replies. Can we use MQGET node for this? If yes, can someone clearly explain how to achive this using get message by corellation id? |
1. Don't open six year-old posts. Start your own.
2. Read the InfoCentre. This is fairly basic operation.
3. Attend the nine days of Training. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|