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 » Aggregate Nodes Question

Post new topic  Reply to topic
 Aggregate Nodes Question « View previous topic :: View next topic » 
Author Message
TonyD
PostPosted: Wed Dec 19, 2007 2:16 pm    Post subject: Aggregate Nodes Question Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

I have a flow that sends an MQ request message to an external app and uses an MQGet loop to receive up to 700 replies with the same CorrelId, terminated with an 'End Of Replies' message.
It has been suggested that I should be using aggregate nodes rather than MQGet, for thread blocking reasons.
Its been a while since I last used aggregate nodes but a quick test showed that reply messages 2-n were rejected because there were no '..corresponding request messages', which is what I expected. Even if I used logical groups I think the result would be the same; it would just mean that the first reply would not be read until the last reply had arrived on the queue
Is there a technique that would allow me to use aggregate nodes for this scenario? I do not know in advance how many reply messages will be returned, hence the need for the 'End OF Replies' marker.
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Wed Dec 19, 2007 3:34 pm    Post subject: Re: Aggregate Nodes Question Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

TonyD wrote:
Is there a technique that would allow me to use aggregate nodes for this scenario?

No. Aggregation assumes 1 Reply per Request.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
sunny_30
PostPosted: Wed Dec 19, 2007 6:45 pm    Post subject: Reply with quote

Master

Joined: 03 Oct 2005
Posts: 258

Tony,
Eddie is right that MB aggregation assumes 1 reply for 1 request.

But, how about you making the MB believe that you have sent 700 requests, instead you just send one. The aggregation then waits for 700 replies back.

Try below (for K=2 to 700):-
This code needs to be added in the node after MQOutput (where one request is already sent) & before the aggregaterequest node.

Code:
SET OutputLocalEnvironment.WrittenDestination.MQ.DestinationData[K].queueName = 'XXXXXXXXXXXX';
SET OutputLocalEnvironment.WrittenDestination.MQ.DestinationData[K].queueManagerName = 'XXXXXXXXXXXX';
SET OutputLocalEnvironment.WrittenDestination.MQ.DestinationData[K].replyIdentifier = UUIDASBLOB || X'0000000000000000';
SET OutputLocalEnvironment.WrittenDestination.MQ.DestinationData[K].msgId = UUIDASBLOB || X'0000000000000000';
SET OutputLocalEnvironment.WrittenDestination.MQ.DestinationData[K].correlId = X'000000000000000000000000000000000000000000000000';

The above code will work. But will not guarantee that the responses received are for the same request made.

Also try below, Im not sure this works, but if it works, you can guarantee that 700 responses received are for the same request made i.e not for the request from the other instance of the flow:

Code:
SET OutputLocalEnvironment.WrittenDestination.MQ.DestinationData[K].queueName = 'XXXXXXXXXXXX';
SET OutputLocalEnvironment.WrittenDestination.MQ.DestinationData[K].queueManagerName = 'XXXXXXXXXXXX';
DECLARE BLOB MsgIdOfFirstRequest = InputLocalEnvironment.WrittenDestination.MQ.DestinationData[1].msgId;
SET OutputLocalEnvironment.WrittenDestination.MQ.DestinationData[K].replyIdentifier = MsgIdOfFirstRequest;
SET OutputLocalEnvironment.WrittenDestination.MQ.DestinationData[K].msgId = MsgIdOfFirstRequest;
SET OutputLocalEnvironment.WrittenDestination.MQ.DestinationData[K].correlId = MsgIdOfFirstRequest;

Note that for Aggregation MB matches the CorrelId of the response to the MsgId of the request made.

Let me know what you find after testing...

-Sunny.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 19, 2007 8:16 pm    Post subject: Reply with quote

Grand High Poobah

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

I believe this would be one for V6.1 which has a collection node to do exactly what you're looking for?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
TonyD
PostPosted: Thu Dec 20, 2007 6:21 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

Thanks for the comments.
Quote:

But, how about you making the MB believe that you have sent 700 requests, instead you just send one. The aggregation then waits for 700 replies back.

I wondered about something along those lines. However I do not know in advance how many reply messages will be returned. If I set a maximum the Aggregate Reply will keep waiting for messages that will never arrive and will then timeout.
Quote:

I believe this would be one for V6.1 which has a collection node to do exactly what you're looking for?

I do not yet have 6.1, but have read the Collection node documentation. The format of my reply messages (not XML) makes me wonder if I would be able to suitably configure an 'event handler' to detect the end of the collection.
In fact the MQGet loop works perfectly satisfactorily for any number of reply messages up to the 1000 maximum that I have set. The consultant's comment was:
Quote:

Some Broker flows are using the MQGet node for long-running requests. The MQGet node is intended to be used for short-running requests such as a SOAP/JMS Web Service call. For long running requests, use of the Aggregate nodes is recommended. The advantage of message aggregation is that the separate WMB flows for the requests and replies are non-blocking and can handle a high throughput with a single thread. With the MQGet node, the message flow thread is blocked until a reply is received or the MQGet node times out.

As we are not seeing performance problems I think that I will leave things the way they are for the time being!
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Dec 20, 2007 8:04 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Is it possible to process the responses individually?

Or do you need to assemble all of them before you can process any of them?

If you can process them individually, you'll get vastly better performance out of using an MQInput rather than an MQGet.

On the third hand, you should evaluate the risk of performance/memory issues with your current setup, against the cost of making changes.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Cliff
PostPosted: Fri Dec 21, 2007 2:10 am    Post subject: Reply with quote

Centurion

Joined: 27 Jun 2001
Posts: 145
Location: Wiltshire

Just to add another design consideration, WMQ is asynchronous and cannot guarantee message sequence unless certain strict criteria are met so do you cater for your 'end of replies' message not actually being the last message? Believe me, it WILL happen at some time.

Aggregation can help here, but you would have to do something like sending one 'real' request message and 699 dummy ones, while the replying app would have to send (say) 650 'real' replies and 50 dummy ones.

Just a thought ...
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Aggregate Nodes Question
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.