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 » How to route a message to one of many queues?

Post new topic  Reply to topic
 How to route a message to one of many queues? « View previous topic :: View next topic » 
Author Message
ram_svnit
PostPosted: Wed Oct 21, 2009 5:20 am    Post subject: How to route a message to one of many queues? Reply with quote

Novice

Joined: 28 Aug 2009
Posts: 20
Location: India

Hi, based on some element value in input XML message i need to route the the output message to a specific MQ output queue.How do i achieve this?
I have changed the Destination Mode of output queue to Destiantion List.
I tried the following code:
SET OutputLocalEnvironment.Destination.MQ.Defaults.queueManager='WBRK61_DEFAULT_QUEUE_MANAGER';
IF InputRoot.XMLNSC.ns1:TargetOrder.ns1:FCAreaCode ='100000' THEN
SET OutputLocalEnvironment.Destination.MQ.Defaults.queueName='FULFILLMENTCENTER1';
ELSEIF InputRoot.XMLNSC.ns1:TargetOrder.ns1:FCAreaCode='100001' THEN
SET OutputLocalEnvironment.Destination.MQ.Defaults.queueName='FULFILLMENTCENTER2';
ELSE
SET OutputLocalEnvironment.Destination.MQ.Defaults.queueName='FULFILLMENTCENTER3';
END IF;
Back to top
View user's profile Send private message Yahoo Messenger
Gaya3
PostPosted: Wed Oct 21, 2009 5:22 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

use Route to Label
or Local Environment.Destination Properties to do the same

you have to use Propagate command to push the data out

and first of all

Go through the MB and MQ Basics, it will give fair idea about this
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die


Last edited by Gaya3 on Wed Oct 21, 2009 5:23 am; edited 1 time in total
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 21, 2009 5:23 am    Post subject: Re: How to route a message to one of many queues? Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

ram_svnit wrote:
I tried the following code:


What happened when you tried this? Presumably not what you wanted?

Did you remember to change the Compute node to pass LocalEnvironment to the MQOutput node?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 21, 2009 5:25 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Gaya3 wrote:
you have to use Propagate command to push the data out


Not necessarially. Propagate is best used when you have to generate 2 or more outputs from a single input. A single input, with multiple destinations, it's better to let WMB handle it.[/quote]
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Oct 21, 2009 5:34 am    Post subject: Re: How to route a message to one of many queues? Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

ram_svnit wrote:

Code:
SET OutputLocalEnvironment.Destination.MQ.Defaults.queueManager='WBRK61_DEFAULT_QUEUE_MANAGER';
      IF InputRoot.XMLNSC.ns1:TargetOrder.ns1:FCAreaCode ='100000' THEN
         SET OutputLocalEnvironment.Destination.MQ.Defaults.queueName='FULFILLMENTCENTER1';
               ELSEIF InputRoot.XMLNSC.ns1:TargetOrder.ns1:FCAreaCode='100001' THEN
         SET OutputLocalEnvironment.Destination.MQ.Defaults.queueName='FULFILLMENTCENTER2';
      ELSE
         SET OutputLocalEnvironment.Destination.MQ.Defaults.queueName='FULFILLMENTCENTER3';
      END IF;

You have got the output side wrong. If should be

Code:

set OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = <insert your name here>

You don't need to set the Queue Manager Name if you are writing to queues defined on the local QM.

Please use the code tags when inserting ESQL, JAva etc into your posts. It makes them much easier to read.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
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 » How to route a message to one of many queues?
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.