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 » Differentiate Two message

Post new topic  Reply to topic
 Differentiate Two message « View previous topic :: View next topic » 
Author Message
saddankula
PostPosted: Thu Jun 27, 2013 1:01 am    Post subject: Differentiate Two message Reply with quote

Acolyte

Joined: 27 Jun 2013
Posts: 51

how we Differentiate Two message sets like MRM and XML data in computenode Through single mqinput node.
Back to top
View user's profile Send private message
Tibor
PostPosted: Thu Jun 27, 2013 2:48 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

If I understand the problem properly, you should
- use BLOB parser at MQInput node and then
- re-parse it inside the Compute node based on the pattern, e.g. every XML arrives with an <?xml> prefix.
Back to top
View user's profile Send private message
saddankula
PostPosted: Thu Jun 27, 2013 2:52 am    Post subject: Validate 2 formats of data from single MQ inputnode. Reply with quote

Acolyte

Joined: 27 Jun 2013
Posts: 51

Hi WMB Developers,

Here I want to validate two formats of input data like XML, MRM through sing MQinput node.
We do not know which format of data will come as input.So I need to check in compute node, Based on input format I will reset the parser of input format with Reset content descriptor.

May I know how in compute node ,decide with format of data as come?

Is that XML or MRM?

I do not know which format of data come to MQinput ,So I take it as a blob format, data which is submit either XML or MRM.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Jun 27, 2013 2:53 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

What Tibor suggested may work; however, this does not overcome the poor design. Generally speaking, a good message system architect will separate the payloads by type into different queues.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Tibor
PostPosted: Thu Jun 27, 2013 3:04 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

I can recommend you lancelotlinc's idea as well.

Or you can use something similar (not tested):
Code:
SET myEncoding = CAST(InputRoot.Properties.Encoding AS INTEGER);
SET myCCSID = CAST(InputRoot.Properties.CodedCharSetId AS INTEGER);

IF CAST(SUBSTRING(InputRoot.BLOB.BLOB FROM 1 FOR 5) AS CHARACTER CCSID 437) = '<?xml' THEN
  CREATE LASTCHILD OF OutputRoot.XML.MessageData
    DOMAIN ('XML')
    PARSE (InputRoot.BLOB.BLOB CCSID myCCSID ENCODING myEncoding OPTIONS FolderBitStream ) ;
ELSE
  CREATE LASTCHILD OF OutputRoot.XML.MessageData
    DOMAIN ('MRM')
    PARSE (InputRoot.BLOB.BLOB CCSID myCCSID ENCODING myEncoding OPTIONS FolderBitStream SET 'MsgSetName' TYPE 'MsgType' FORMAT 'TDS1') ;
END IF;
Back to top
View user's profile Send private message
Esa
PostPosted: Thu Jun 27, 2013 3:20 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

Even if you get the messages from one queue, they probably come from different sources. They can have different user identity, for example.
If your environment is secure

If the MQI program in one of the sending applications can be changed, they could add something in MQMD.ApplIdentityData (for example)
that you could use for identifying the message source and type.

I would examine the MQMD headers of both messages carefully and try to find something that could be used to identify the message types.
I think that would be a better approach than examining the payload.

And, you don't have to parse the messages programmatically. A simple filter node wired to two ResetContentDescriptor nodes will do.


Last edited by Esa on Thu Jun 27, 2013 3:25 am; edited 1 time in total
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Jun 27, 2013 3:23 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

The application name associated with the message could also be unique for that matter... (MQMD.PutApplName);

http://publib.boulder.ibm.com/infocenter/wbifn/v3r1m0/index.jsp?topic=%2Fcom.ibm.dni310.mp.doc%2Fdnf_ic_mp386.htm
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
NealM
PostPosted: Thu Jun 27, 2013 1:51 pm    Post subject: Reply with quote

Master

Joined: 22 Feb 2011
Posts: 230
Location: NC or Utah (depends)

Having done it both ways,
(1) BLOB input -->Compute node with two parsers inside
(2) BLOB input -->Filter node with two RCDs hanging off the True/False terminals,
(and you always have to start with the BLOB domain in a case like this),
I would go with #2 as being a bit clearer down the road when maintenance might be required. Always think of the next guy having to pick up what you did.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jun 27, 2013 9:02 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Tibor wrote:
e.g. every XML arrives with an <?xml> prefix.


Not entirely true. That prefix is optional. I see many messages every day that do not have this prefix.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Tibor
PostPosted: Fri Jun 28, 2013 1:04 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

smdavies99 wrote:
Not entirely true. That prefix is optional. I see many messages every day that do not have this prefix.


That's why I wrote e.g. ...
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 » Differentiate Two message
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.