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 » IBM MQ API Support » Setting message to particular Queue

Post new topic  Reply to topic
 Setting message to particular Queue « View previous topic :: View next topic » 
Author Message
Naftalanja
PostPosted: Thu Jan 31, 2002 11:35 pm    Post subject: Reply with quote

Acolyte

Joined: 30 Jan 2002
Posts: 63
Location: Los Angeles

Hi am new to MQSI and ESQL. I have ma basic message flow working with simple ESQL. I have an XML message as below

<?xml version="1.0"?>
<!DOCTYPE TSC [
<!ELEMENT TSC (REQUEST)>
<!ELEMENT REQUEST (QUERYBASE)>
<!ELEMENT QUERYBASE (FIRSTNAME, LASTNAME, EMPID)>
<!ELEMENT FIRSTNAME (#PCDATA)>
<!ELEMENT LASTNAME (#PCDATA)>
<!ELEMENT EMPID (#PCDATA)>
]>
<TSC>
<REQUEST>
<QUERYBASE>
<EMPID>0</EMPID>
</QUERYBASE>
</REQUEST>
</TSC>

Depending on the EMPID, i wanted to send the message to diffrent Queues.

for eg. if EMPID = 1 THEN i want to send message to (Queue ) Q1
if EMPID = 2 THEN i want to send message to (Queue ) Q2.

Also i have another question.
I have ESQL as

IF OUTPutroot.XML.TSC.REQUEST.QUERYBASE.EMPID = '0' THEN
DO SOMETHING ....
END IF.

The loop never executes "DO SOMETHING".

Any help will be greatly appreciated. Thanx
Back to top
View user's profile Send private message Send e-mail
NickB
PostPosted: Fri Feb 01, 2002 2:22 am    Post subject: Reply with quote

Centurion

Joined: 20 May 2001
Posts: 107
Location: Zurich Financial Services

1) You need to use a filter node to test the value of EMPID in order to do a branch, e.g. the condition in the filter node would be something like:

Root.TSC.REQUEST.QUERYBASE.EMPID = '1'

2) I suggest you put a trace node in your flow and dump out ${Root} to see the value of the message to verify the contents of your EMPID field.

Back to top
View user's profile Send private message
Naftalanja
PostPosted: Fri Feb 01, 2002 11:18 am    Post subject: Reply with quote

Acolyte

Joined: 30 Jan 2002
Posts: 63
Location: Los Angeles

Hi nick thanx for the solution. But ma first kuestion remains the same. If i wanted to route the message to particular queue basing on the kondition, how do i do, do i implement the filter node ???? thanx
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Fri Feb 01, 2002 12:40 pm    Post subject: Reply with quote

Jedi

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

Another way of achieving the message delivery routing would be to use a Destination List, with a single entry in it. This could all be done in the same Compute node and then the Filter would not be needed and there would only be a single Output node. This approach would be even more benificial if there were multiple routes to choose from.

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
Naftalanja
PostPosted: Fri Feb 01, 2002 12:56 pm    Post subject: Reply with quote

Acolyte

Joined: 30 Jan 2002
Posts: 63
Location: Los Angeles

I think i would use Compute node for passing the message to different destinations. thanks for the tip . Can you please xplain me how can i define destination lists ?? also can you please tell me how can i route the messages to those destination lists. thanx, I mean a sample code would do.
Back to top
View user's profile Send private message Send e-mail
Naftalanja
PostPosted: Fri Feb 01, 2002 12:56 pm    Post subject: Reply with quote

Acolyte

Joined: 30 Jan 2002
Posts: 63
Location: Los Angeles

I think i would use Compute node for passing the message to different destinations. thanks for the tip . Can you please xplain me how can i define destination lists ?? also can you please tell me how can i route the messages to those destination lists. thanx, I mean a sample code would do.
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Fri Feb 01, 2002 10:16 pm    Post subject: Reply with quote

Jedi Knight

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

You can use following ESQL in compute node to do this,

IF (InputRoot.XML.TSC.REQUEST.QUERYBASE.EMPID = 1) THEN
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName = 'Q1';
ELSE IF (InputRoot.XML.TSC.REQUEST.QUERYBASE.EMPID = 2) THEN
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName = 'Q2';
ENDIF;

Make sure In your Compute Node (under Advanced Tab), you set the 'Compute Mode' to 'All'.

Regards,
Kiran
Back to top
View user's profile Send private message Visit poster's website
Naftalanja
PostPosted: Mon Feb 04, 2002 4:37 pm    Post subject: Reply with quote

Acolyte

Joined: 30 Jan 2002
Posts: 63
Location: Los Angeles

Thanx kirani, i think i will use it though. Thanx for your time.

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 » IBM MQ API Support » Setting message to particular Queue
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.