Author |
Message
|
sboucher |
Posted: Sat Dec 14, 2002 12:10 am Post subject: Reading MQMD Header |
|
|
Acolyte
Joined: 27 Oct 2002 Posts: 52
|
I will be having messages coming to me from various offices involving various functions.
I was told it is possible to set-up one Q to act as a "traffic cop" and have each office embed an application id in the MQMD header and then the messages can be routed to their final destination Q based on this applID
I don't have a clue on how to read the MQMD Header and route the messages. If someone could help me or point me in the right direction with what manual to read, I sure would appreciate it.
Thanks
Scott _________________ Scott A. Boucher
Database Administartor |
|
Back to top |
|
 |
kirani |
Posted: Sat Dec 14, 2002 1:28 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Hi Scott,
Let's say 2 offices are sending you messages and they set application-id in MQMD.ApplIdentityData field. You could use following code to route messages to output queue,
Code: |
IF ( TRIM(InputRoot.MQMD.ApplIdentityData) = 'OFF1') THEN
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueManagerName = 'QM1'
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = 'Queue1'
ELSEIF ( TRIM(InputRoot.MQMD.ApplIdentityData) = 'OFF2') THEN
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueManagerName = 'QM2'
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = 'Queue1'
END IF;
|
Make sure your select DestinationList in your MQOutput node in Advanced tab. _________________ 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 |
|
 |
LearnMQSI |
Posted: Mon Jan 13, 2003 6:06 am Post subject: MQSI |
|
|
 Centurion
Joined: 20 Aug 2002 Posts: 137
|
Hi Kiran,
Looks like you have good exposure to MQSI. I'm learning MQSI. What suggestions you have for me. Specially learing ESQL.
Is there any website or any manual(s) I should refer?
I have good knowledge of using MQSI GUI but when it comes to coding, I'm little behind.
I appreciate your help.
Thanx |
|
Back to top |
|
 |
kirani |
Posted: Mon Jan 13, 2003 4:13 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Hi,
I'd recommend following books to start with,
SG246579 - Developing Solutions in WebSphere MQ Integrator
SG246509 - WebSphere MQ IntegratorDeployment and Migration
WMQI 2.1 ESQL Reference manual. _________________ 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 |
|
 |
sboucher |
Posted: Wed Jan 29, 2003 5:54 am Post subject: |
|
|
Acolyte
Joined: 27 Oct 2002 Posts: 52
|
I am receiving a syntax error when I use a CASE statement in my compute node. I want to route messages to a certain Q based on the MQMD.ApplIdentitydata value. Here is my code:
SET OutputRoot = InputRoot;
--Enter SQL below this line. SQL above this line might be regenerated, causing any
--modifications to be lost.
DECLARE INTFID CHARACTER;
DECLARE QMGR CHARACTER;
DECLARE QNAME CHARACTER;
SET OutputRoot.MQMD = InputRoot.MQMD;
SET INTFID = TRIM(InputRoot.MQMD.ApplIdentityData);
SET QMGR = 'LBWMQT01';
CASE INTFID
WHEN INTFID='INTF_0215' THEN SET QNAME = 'HRQ'
WHEN INTFID='INTF_0336' THEN SET QNAME = 'SUPLORDQ'
ELSE SET QNAME='FAIL'
END
SET OutputDestinationList.Destination.MQDestinationList.Defaults.transactionMode= 'yes';
SET OutputDestinationList.Destination.MQDestinationList.Defaults.persistenceMode= 'yes';
SET OutputDestinationList.Destination.MQDestinationList.Defaults.newMsgId= 'yes';
SET OutputDestinationList.Destination.MQDestinationList.Defaults.newCorrelId= 'no';
SET OutputDestinationList.Destination.MQDestinationList.Defaults.segmentationAllowed= 'no';
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueManagerName =QMGR;
SET OutputDestinationList.Destination.MQDestinationList.DestinationData[1].queueName = QNAME;
SET OutputRoot.MQMD.Format = 'MQSTR'; _________________ Scott A. Boucher
Database Administartor |
|
Back to top |
|
 |
Coz |
Posted: Wed Jan 29, 2003 6:48 am Post subject: |
|
|
 Apprentice
Joined: 20 Feb 2002 Posts: 44 Location: Basel CH
|
I'm a bit rusty but after consulting the ESQL manual it's cos your syntax is wrong.
SET QNAME = ( CASE INTFID
WHEN 'INTF_0215' THEN 'HRQ'
WHEN 'INTF_0336' THEN 'SUPLORDQ'
ELSE 'FAIL'
END ); |
|
Back to top |
|
 |
|