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 » Reading MQMD Header

Post new topic  Reply to topic
 Reading MQMD Header « View previous topic :: View next topic » 
Author Message
sboucher
PostPosted: Sat Dec 14, 2002 12:10 am    Post subject: Reading MQMD Header Reply with quote

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
View user's profile Send private message Send e-mail
kirani
PostPosted: Sat Dec 14, 2002 1:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
LearnMQSI
PostPosted: Mon Jan 13, 2003 6:06 am    Post subject: MQSI Reply with quote

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
View user's profile Send private message
kirani
PostPosted: Mon Jan 13, 2003 4:13 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sboucher
PostPosted: Wed Jan 29, 2003 5:54 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Coz
PostPosted: Wed Jan 29, 2003 6:48 am    Post subject: Reply with quote

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
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 » Reading MQMD Header
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.