Author |
Message
|
Naftalanja |
Posted: Thu Jan 31, 2002 11:35 pm Post subject: |
|
|
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 |
|
 |
NickB |
Posted: Fri Feb 01, 2002 2:22 am Post subject: |
|
|
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 |
|
 |
Naftalanja |
Posted: Fri Feb 01, 2002 11:18 am Post subject: |
|
|
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 |
|
 |
EddieA |
Posted: Fri Feb 01, 2002 12:40 pm Post subject: |
|
|
 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 |
|
 |
Naftalanja |
Posted: Fri Feb 01, 2002 12:56 pm Post subject: |
|
|
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 |
|
 |
Naftalanja |
Posted: Fri Feb 01, 2002 12:56 pm Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Fri Feb 01, 2002 10:16 pm Post subject: |
|
|
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 |
|
 |
Naftalanja |
Posted: Mon Feb 04, 2002 4:37 pm Post subject: |
|
|
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 |
|
 |
|