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 » Processing a RFH2 and content inside BLOB

Post new topic  Reply to topic
 Processing a RFH2 and content inside BLOB « View previous topic :: View next topic » 
Author Message
llaros
PostPosted: Tue Dec 22, 2009 7:40 am    Post subject: Processing a RFH2 and content inside BLOB Reply with quote

Apprentice

Joined: 22 Jan 2008
Posts: 37

Hi

My flow receives a message that contains:
MQMD, MQRFH and a payload. I have to take the payload and put it to the output queue without using a parser. The thing is that the payload of the receiving message contains RFH2 and a payload1.
Incoming message structure:
InputRoot.MQMD
InputRoot.MQRFH2
InputRoot.BLOB.BLOB=this blob contains RFH2 and payload1 (let name them InputRoot.BLOB.BLOB.RFH2 and InputRoot.BLOB.BLOB.payload1)

I want to build output msg that will have:
OutputRoot.MQMD=InputRoot.MQMD
OutputRoot.MQRFH2=InputRoot.BLOB.BLOB.RFH2
OutputRoot.BLOB.BLOB=InputRoot.BLOB.BLOB.payload1

My code:



Code:

SET OutputRoot.MQMD = InputRoot.MQMD;
CREATE LASTCHILD OF OutputRoot DOMAIN('BLOB') NAME 'BLOB';
 SET OutputRoot.BLOB.BLOB = InputRoot.BLOB.BLOB;
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;



But the Broker ignores the last line because he does not see the MQRFH2 subtree of the InputRoot. Is there a method to
a) parse some portion of BLOB inside MQRFH2 structure/subtree
b) override the MQMD.Format
c) make some other trick that will tell the broker that the BLOB contains RFH2

Thanks for your help
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Dec 22, 2009 7:58 am    Post subject: Re: Processing a RFH2 and content inside BLOB Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

llaros wrote:
I have to take the payload and put it to the output queue without using a parser.


Why?What's wrong with using a parser?

llaros wrote:
a) parse some portion of BLOB inside MQRFH2 structure/subtree


You said you didn't want to parse the message.

llaros wrote:
b) override the MQMD.Format


How will that help? Without parsing, you don't know how long the RFH2 is

llaros wrote:
c) make some other trick that will tell the broker that the BLOB contains RFH2


It's called parsing the message.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
llaros
PostPosted: Tue Dec 22, 2009 8:55 am    Post subject: Reply with quote

Apprentice

Joined: 22 Jan 2008
Posts: 37

I don't want to use a parser to parse the payload1 not the payload. Thats all.

Code:

DECLARE structLength BLOB SUBSTRING(InputRoot.BLOB.BLOB from 9 for 4);
DECLARE blobZero BLOB 'X''00000000''';
SET structLength = blobZero||structLength;
DECLARE structLengthINT INT CAST(structLength AS INT);
DECLARE MyMQRFH2 BLOB SUBSTRING(InputRoot.BLOB.BLOB from 1 for structLengthINT);
DECLARE MyBody BLOB SUBSTRING(InputRoot.BLOB.BLOB from structLengthINT+1 for LENGTH(InputRoot.BLOB.BLOB));    
   

But still I can't do:
Code:

SET OutputRoot.MQRFH2 = MyMQRFH2;


Is there a way to parse BLOB into MQRFH2?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Dec 22, 2009 9:38 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

llaros wrote:
Is there a way to parse BLOB into MQRFH2?


Only by parsing the message. The method you posted (despite it's various coding issues) fails on the fact the RFH2 is a variable length structure. Without looking, you can't know how long it is.

You could extract the details by coding the position of the length indicators, then casting & substringing. It might work but is it worth the trouble when the parser will do it for you?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 22, 2009 9:11 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You guys may call me crazy but I would have thought that if the RFH headers were correctly chained, they would display correctly in the tree, even if you used the BLOB domain...

So how are the Headers chained in the message?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
imakash
PostPosted: Wed Dec 23, 2009 4:58 am    Post subject: Reply with quote

Newbie

Joined: 22 Dec 2009
Posts: 7

try

SET OutputRoot.MQRFH2 = null;

then reparse the output tree. the tree that you will get will have MQMD, MQRFH2 and your payload1 as payload.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Dec 23, 2009 5:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

imakash wrote:
then reparse the output tree. the tree that you will get will have MQMD, MQRFH2 and your payload1 as payload.


Implying the tree was initially parsed in the first place, which the poster seems keen to avoid.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Dec 23, 2009 6:23 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You should be able to use CREATE FIELD to turn your BLOB field containing the MQRFH portion into an MQRFH tree.
Back to top
View user's profile Send private message
llaros
PostPosted: Wed Dec 23, 2009 10:24 am    Post subject: Reply with quote

Apprentice

Joined: 22 Jan 2008
Posts: 37

Thanks to you all.

I've done this yesterday using CREATE statement what Victor had been suggesting ... I forgot to post this here.

Thanks again
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 » Processing a RFH2 and content inside BLOB
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.