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 » Can I route messages to more than one label?

Post new topic  Reply to topic
 Can I route messages to more than one label? « View previous topic :: View next topic » 
Author Message
brokendrum
PostPosted: Fri Mar 07, 2003 3:28 am    Post subject: Can I route messages to more than one label? Reply with quote

Apprentice

Joined: 14 Jan 2003
Posts: 34

I need to route a message to multiple labels, i.e. create multiple instances of the message and send them to different labels. I've tried the following code but without much luck;

SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname[1] = 'Label1';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname[2] = 'Label2';


Any ideas?
Back to top
View user's profile Send private message
lillo
PostPosted: Fri Mar 07, 2003 5:14 am    Post subject: Reply with quote

Master

Joined: 11 Sep 2001
Posts: 224

Have you try the propagate statement? PROPAGATE is new in WMQI 2.1.
_________________
Lillo
IBM Certified Specialist - WebSphere MQ
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Mar 07, 2003 6:21 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think you need to say
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'Label1';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[2].labelname = 'Label2';

instead of
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname[1] = 'Label1';
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname[2] = 'Label2';

That is, you need to create a list of DestinationData fields, each one having one single lablename field.
Back to top
View user's profile Send private message
brokendrum
PostPosted: Fri Mar 07, 2003 9:02 am    Post subject: Reply with quote

Apprentice

Joined: 14 Jan 2003
Posts: 34

lillo - The PROPAGATE function has the required effect, Thanks.

Jeff - I don't think this will work because the route to label node has the option to route either to the first or last destination in the list. Correct me if I'm wrong though. I did try something like this before I posted the question but with no luck. Thanks for your input anyway.
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Mar 07, 2003 9:18 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

In addition to what Jeff said, you also need to have multiple RouteToLabel nodes in your message flow for it to work.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Yanghui
PostPosted: Mon May 26, 2003 2:49 am    Post subject: Reply with quote

Disciple

Joined: 08 May 2002
Posts: 151
Location: Dublin, Ireland

Does this mean it's only able to route a message to two labels, one for "Route To First" and another for "Route To Last"?

Thanks

-Yanghui
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Mon May 26, 2003 11:03 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

With each RouteToLabel node, depending on a field value, you can route your message to N label nodes. So if you want to route based on 2 fields, then you will need 2 RouteToLabel nodes.

I think in the given scenario you are trying to route based on single field, so your ESQL code should be ...

Code:

If  (condition1) THEN
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'Label1';
ELSEIF (condition2) THEN
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'Label2';
ELSEIF (condition3) THEN
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'Label3';
END IF;


Hope this helps.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Yanghui
PostPosted: Wed May 28, 2003 1:45 am    Post subject: Reply with quote

Disciple

Joined: 08 May 2002
Posts: 151
Location: Dublin, Ireland

Hi, Kirani,

Thanks for your reply.

I notice that you used ELSEIF in your ESQL. I remember I always got syntax error if I did so (NT+CSD2). What works for me is only something like:

IF... THEN
....
ELSE
IF ... THEN
...
ELSE
IF ... THEN
...
ELSE
END IF;
END IF;
END IF;

It would be much nicer if we can use something like:

IF ... THEN
...
ELSEIF ... THEN
...
ELSEIF ... THEN
...
END IF;

Do you really make the late one work? How? Thanks.

Regards

-Yanghui
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Thu May 29, 2003 9:10 am    Post subject: Reply with quote

Jedi

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

When you have multiple labels in the LocalEnvironment, the Route to Label node sends it to either the first, or the last depending on the Properties. It then REMOVES that one from the list so that the next Route to Label will send it to the next one specified (again based on first or last).

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
Yanghui
PostPosted: Fri May 30, 2003 12:43 am    Post subject: Reply with quote

Disciple

Joined: 08 May 2002
Posts: 151
Location: Dublin, Ireland

Eddie,
Thanks for your response.
I never know the labels can work like this way. I am wondering in which circumstance the feature can be exploied. Frankly, most time when you want to route msg to different label, logically you already know which label should be routed to. Why is it still bothered to choose the first or the last ones? Do you have any experience of using this feature? Many thanks in advance.

Regards

-Yanghui
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 » Can I route messages to more than one label?
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.