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 » Doubt in Handling BLOB Messages

Post new topic  Reply to topic Goto page 1, 2  Next
 Doubt in Handling BLOB Messages « View previous topic :: View next topic » 
Author Message
vk
PostPosted: Wed Feb 08, 2006 12:49 pm    Post subject: Doubt in Handling BLOB Messages Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

Hi,

Why do we need to set the property 'Copy Message Headers' in the compute node (WMQI 2.1) when dealing with BLOB messages?

I have a scenario where the incoming message can be of 2 types. I am using a compute node in the beginning of the message flow to determine the message type (First 5 bytes of the incoming BLOB) and then route it to the respective subflow for further processing. Each subflow has a RCD node to reset the message to TDS.

Initially, I had set 'Copy Entire Message' in the compute node. This did not give me any errors during development. But in the Test environment, where the message came directly from an AS/400 system (CCSID 37), the message failed in the subflow during a database fetch. Execution group trace showed that the characters were unreadable.

Interestingly, when I requeued the backed out message, it went through without any problems. This time though, the trace showed that the CCSID was 817.

Then I changed the compute node setting to 'Copy Message Headers' and then the messages coming directly from the AS/400 system were also processed without issues.

Why do we need to use this setting when dealing with BLOB messages? I found many threads here related to this. But none of them say, why this setting is required.

Thanks,
VK.
Back to top
View user's profile Send private message
shalabh1976
PostPosted: Wed Feb 08, 2006 7:46 pm    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

vk,
any valid mq message has two parts : the header and the body. There can be multiple headers but MQMD is the least that should be there. MQ is least bothered about the body and the parser used to parse the message (XML, BLOB or MRM). For any valid MQ message the header has to be there and as such you must either select copy message headers or copy entire message(in which case the headers are automatically copied).
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
vk
PostPosted: Wed Feb 08, 2006 8:57 pm    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

Hi,

In my first compute node, I am saving the MsgId in the MQMD header of the incoming message to an Environment variable. In the last compute node, before sending the message to the output queue, I am setting the MsgId and Format variables in MQMD header for the outgoing message.

This is working for all the interfaces. In the compute nodes in between, I am not doing Copy Message Headers or Copy Entire Message. I am doing manipulations on the incoming message body.

Here what is puzzling me is without 'Copy Message Headers' setting, the original message from the AS/400 system fails. But the same message which I requeue from the backout queue is being processed without errors.

Thanks,
VK.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Wed Feb 08, 2006 9:35 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi vk,

Ok, we got the point that you are not doing CopyMessageHeaders, but you are doing CopyEntireMessage ?
If you are, then that is nothing but CopyMessageHeaders + copying Message Body.....

So the issue might not be the CopyMessageHeaders...

Why dont you post the Message that ur receiving from the AS/400 by stopping the flow, and also the message in a trace right after your parser is invoked in the flow(we wont figure out anything from a BLOB message)

Regards.
Back to top
View user's profile Send private message Send e-mail
vk
PostPosted: Thu Feb 09, 2006 5:59 am    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

Hi,

In all my compute nodes, I am doing neither 'Copy Message Headers' nor 'Copy Entire Message'. In the first compute node after I receice a message, I am storing the MsgId in MQMD Header to an environment variable. Then in the last compute node, just before the output node, I am setting the MsgId and Format fields in the MQMD header for the output message.

In all intermediate compute nodes, I do only manipulation of the message body. In the first compute node, after I determine the type of the incoming message, I am doing OutputRoot.BLOB.BLOB = InputRoot.BLOB.BLOB;

In the later subflows, I am using RCD nodes to reset BLOB to the respective TDS message in MRM domain.

The incoming message seems proper, as in my first compute node, I am casting BLOB to String. In the execution group trace, I can see all characters properly. Also the message in the input queue (which I retrieved after stopping the flow) and also the mesaage which goes to the backout queue, look proper.

My flow is working with 'Copy Message Headers' setting. But I am trying to figure out why this is required?

My initial thoughts were that when an RCD node is encountered, the entire message will be reparsed by the new parser, which will need the headers too. But if this is the case, why does the message which I requeue from the backout queue, gets processed successfully?

Thanks,
VK.
Back to top
View user's profile Send private message
mgk
PostPosted: Thu Feb 09, 2006 6:51 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

Can you post your esql for the last compute node?
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
vk
PostPosted: Thu Feb 09, 2006 7:06 am    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

I am not posting the mapings for the message body. That is too big. Here are the other settings -

SET OutputRoot.Properties.MessageSet = 'E04LFD028M001';
SET OutputRoot.Properties.MessageType = 'PriceList';
SET OutputRoot.Properties.MessageDomain = 'MRM';
SET OutputRoot.Properties.MessageFormat = 'TDS';

--Setting the Message Header
SET OutputRoot.MQMD.Format = 'MQSTR ';
SET OutputRoot.MQMD.MsgId = Environment.Variables.MsgId;

--Destination List to Queue Name
SET OutputLocalEnvironment.Destination.MQDestinationList.DestinationData[1].queueName = Environment.Variables.DestinationQ;

Regards,
VK.
Back to top
View user's profile Send private message
mgk
PostPosted: Thu Feb 09, 2006 7:15 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

But in which order do you do the message body mappings? If you do this code after the message body mappings,

Code:
SET OutputRoot.MQMD.Format = 'MQSTR ';
SET OutputRoot.MQMD.MsgId = Environment.Variables.MsgId;


Then the MQMD will be created after the body which will fail.


regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
vk
PostPosted: Thu Feb 09, 2006 7:19 am    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

Hi,

I am doing the MQMD header mappings in the beginning of the compute node, The mappings for the message body come after these settings.

Thanks,
VK.
Back to top
View user's profile Send private message
mgk
PostPosted: Thu Feb 09, 2006 9:17 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

Can you post a clearer description of your flow design and post the error messages you are getting please
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
vk
PostPosted: Thu Feb 09, 2006 12:34 pm    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

Hi,

Please find below the structure of my flow -

Input Node - (Message Domain BLOB)

Compute Node 1 - (No setting of Copy Message Headers or Copy Entire Message. Determines the message type from first 5 bytes and sets a label for use by RouteToLabel node. MsgId is stored in an environment variable. OutputRoot.BLOB.BLOB = InputRoot.BLOB.BLOB)

RouteToLabel Node
Label Node
ResetContentDescriptor - (Changes the message domain to MRM-TDS)

Compute Node 2 - (No setting of Copy Message Headers or Copy Entire Message. MsgId and Format of output MQMD header is set. Transforms the message body to destination format)

Output Node
------------------------------------------------------------------------------------
Test Cases -
1. When I put the message directly in the queue in AIX queue manager from MQ Explorer, it gets processed without any errors.

2. When the message comes from AS/400 system - In Compute Node 2, I am doing a database query based on incoming values. I am throwing a user exception if no entry is found in the table. Here the values used for database query are unreadable. Execution Group trace also shows unreadable characters after RCD node.

Message goes to backout queue in this case. If I move this message back to input queue for the message flow, it gets processed without any errors.

3. When I set 'Copy Message Headers' in Compute Node 1, then all cases work.

Thanks,
VK.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Thu Feb 09, 2006 9:15 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi vk,
Quote:
1. When I put the message directly in the queue in AIX queue manager from MQ Explorer, it gets processed without any errors.

So that means the Headers are being created by the Put Message...

For the 2nd one, you are certain that the failure is due to the database query returning null.
Quote:
Message goes to backout queue in this case. If I move this message back to input queue for the message flow, it gets processed without any errors.

I dont get this, when you put the message back, dosen't it query the database again or are you providing some default values ?

Quote:
3. When I set 'Copy Message Headers' in Compute Node 1, then all cases work.

If so then that means that, since you are not using the CopyMessageHeaders, you are setting the headers values and forgetting to set something, use the debugger to find the difference in both...

Also, I noticed that you are using
Quote:
OutputRoot.BLOB.BLOB = InputRoot.BLOB.BLOB

not saying that its wrong, but this means that the message body is in atag BLOB within the Root.BLOB...maybe u want it that way`, just bringing it to your notice.

Regards.
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Fri Feb 10, 2006 1:49 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

elvis_gn: BLOB.BLOB is the Correct usage for the BLOB parser domain.

Quote:
Also, I noticed that you are using
Quote:
OutputRoot.BLOB.BLOB = InputRoot.BLOB.BLOB

not saying that its wrong, but this means that the message body is in atag BLOB within the Root.BLOB...maybe u want it that way`, just bringing it to your notice.

_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Fri Feb 10, 2006 2:01 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi mgk,

I know it works...I just had a doubt if he wanted it to be
OutputRoot.BLOB = InputRoot.BLOB;
OR
OutputRoot.BLOB.BLOB = InputRoot.BLOB.BLOB;

Is there something like OutputRoot.XML = InputRoot.XML; or will it be OutputRoot.XML.XML = InputRoot.XML.XML;

I need a break

Regards
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Fri Feb 10, 2006 5:06 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

In theory, you should be able to use
Code:
set OutputRoot.BLOB = InputRoot.BLOB;
to copy the message data, because it will copy the child node InputRoot.BLOB.BLOB.

But you can't use InputRoot.BLOB to access the BLOB data ,becuase the data is at InputRoot.BLOB.BLOB.

Remember that the form is <body>.<parser>.<data elements>. So yes, you could have InputRoot.XML.XML - if the xml data was rooted at an element <XML>. But that would be questionable design.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Doubt in Handling BLOB Messages
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.