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 IndexWebSphere Message Broker (ACE) SupportDynamically deciding Queue Names to put messages?

Post new topicReply to topic
Dynamically deciding Queue Names to put messages? View previous topic :: View next topic
Author Message
Thripura Sundari
PostPosted: Tue Jul 19, 2005 10:28 am Post subject: Dynamically deciding Queue Names to put messages? Reply with quote

Acolyte

Joined: 13 Jun 2005
Posts: 57
Location: Bangalore, India

Hi all,
I need to process some rules with the request message and do some sort of data transformation. The kind of data transformation that is required varies according to the rule.
So, if I have my compute node executing a set of rules, how do I decide on what kind of data transformation is required? it is fine if I can put the appropriate message format in a queue in I need to decide based on the rules.
I am not sure if this relates to dynamic queues. But here I would be dynamically deciding which queue to put the message in and not generating the queue dynamically.
I already have some message flows in which I have performed some simple data transformation. I would like to know how to specify which flow to invoke. (In other words, which queue to put the message in...)
The environment is WBIMB 5.0 with WMQ5.3. I donot have a rules formatter.
If some one could help, Thanks.

Regards,
Thripura Sundari.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 19, 2005 10:32 am Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can use the RouteToLabel node to choose different execution paths through your flow, in order to different transformations to the input message. Your compute node can look at the incoming message, and the rules, and decide what label to set in the LocalEnvironment tree.

Likewise, you can configure the MQOutput node to use a DestinationList, and use a Compute node to create a single item DestinationList in the LocalEnvironment tree. Then the MQOutput node will write the message to that queue, determined dynamically by your code.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
chanduy9
PostPosted: Tue Jul 19, 2005 10:37 am Post subject: Reply with quote

Disciple

Joined: 28 Nov 2001
Posts: 177
Location: USA

and dont forget to set the Compute Mode options as required in the Advance tab of the compute node.
Thanks,
Chandra.
Back to top
View user's profile Send private message
Thripura Sundari
PostPosted: Tue Jul 19, 2005 5:26 pm Post subject: Reply with quote

Acolyte

Joined: 13 Jun 2005
Posts: 57
Location: Bangalore, India

Hi,
Thanks to both of you for the responses. I shall try them out and let you know. As I thought about it, I gpt one more question that I would like ask. Is it possible to use the combination of Aggregate nodes here along with Routeto Latel. I need to send multiple requests based on the rules and aggregate all the replies to the request and send one response.
Thanks.
Regards,
Thripura Sundari
Back to top
View user's profile Send private message
malammik
PostPosted: Tue Jul 19, 2005 6:18 pm Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

Here is how you do it. The mq output node can deliver the message to any queue that is the reply-to-q. You figure out where the message needs to go and set the reply-to-q to that queue. Make sure output node delivery mode is set to reply-to-q.
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
Thripura Sundari
PostPosted: Wed Jul 20, 2005 8:17 am Post subject: Reply with quote

Acolyte

Joined: 13 Jun 2005
Posts: 57
Location: Bangalore, India

Hi,
Thank you very much. I worked out the RouteToLabel alone and that is wokring fine. I need to combine it with the Aggregate reply node which I have not yet completed. Once I complete that, I shall conbine both and let you know the results.
Thanks for your help.
Regards,
Thripura Sundari
Back to top
View user's profile Send private message
JustFriend
PostPosted: Sun Aug 14, 2005 10:04 pm Post subject: Reply with quote

Novice

Joined: 30 May 2005
Posts: 22

Route to Queue:

I am presuming that your Input message is in XML format:

Code:
The Flow:
MQInput  >> Compute1 >> MQOutput


Use the below ESQL in the Compute1 Node:
Code:
CALL CopyMessageHeaders();
CALL CopyEntireMessage();
SET OutputLocalEnvironment = InputLocalEnvironment;


IF(InputRoot.XML.(XML.Element)*[1].XMLTag)) = ‘MyCondition’ THEN
   SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = ‘Q_NAME’;
ELSE
   SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = ‘ERROR_Q_NAME’;
END IF;
RETURN TRUE;



Set the following properties in the MQOutput Node:
Basic:
Queue Manager Name : <blank>
Queue Name : <blank>

Advanced:
Destination Mode : Destination List
Transaction Mode : Automatic
Persistence Mode : Automatic
New Message ID : <unchecked>
New Correlation ID : <unchecked>
Segmentation Allowed : <unchecked>
Message Context : Pass All
Alternate User Authority : <unchecked>

Request:
Request : <unchecked>
Reply-to queue manager : <blank>
Reply-to queue : <blank>

The important settings in the above are:
1) OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName
2) Setting the “Destination Mode” as “Destination List” in the MQOutput Node

Hope this solves your problem.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
RebeccaBarnes
PostPosted: Fri Jul 11, 2025 8:50 am Post subject: Reply with quote

Newbie

Joined: 13 Jun 2022
Posts: 3

Hi Thripura,

Based on your description, it sounds like you want to implement a sort of routing logic, where after evaluating your rules, you determine both the data transformation to apply and which queue (and thus which flow) should handle the transformed message.

In WBIMB (WebSphere Business Integration Message Broker) 5.0 with WMQ 5.3, a common approach is:

Have your compute node examine the message content and apply your rules to decide what transformation is needed.

Set a property (for example, in the MQRFH2 or a custom header) or directly modify the DestinationQueue field in the MQMD to steer the message to the correct output queue.

Each queue would then be connected to the flow designed to process that specific message format.

Since you don?t have a rules formatter, you can handle rule evaluation programmatically inside your compute node ESQL (or Java if you?re using JavaCompute). Essentially:

Evaluate rules within the compute node.

Transform the message data according to the rule.

Set the OutputRoot.MQMD.PutDestinationQueue to the appropriate queue name.

Example in ESQL might look like:

Code:
esql

IF ruleA THEN
    -- transform data for ruleA
    SET OutputRoot.MQMD.PutDestinationQueue = 'QUEUE.A';
ELSEIF ruleB THEN
    -- transform data for ruleB
    SET OutputRoot.MQMD.PutDestinationQueue = 'QUEUE.B';
ELSE
    -- default processing
    SET OutputRoot.MQMD.PutDestinationQueue = 'DEFAULT.QUEUE';
END IF;

This way, you don't have to dynamically create queues, just decide dynamically which existing queue to use. Your flows will pick up messages from their respective queues.

If you have already set up multiple flows listening on different queues, this pattern fits well and keeps your design clean.

Hope that helps! Let me know if you?d like an example snippet more tailored to your exact data structures.

Best regards.
_________________
I love AI stuff. I use https://overchat.ai/chat/best-free-ai-chat most often ? the best free multichat with GPT, Claude and others, without ads and registrations. I recommend it!
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportDynamically deciding Queue Names to put messages?
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.