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 » Length of Data using Broker

Post new topic  Reply to topic
 Length of Data using Broker « View previous topic :: View next topic » 
Author Message
angka
PostPosted: Mon Jul 31, 2006 1:39 am    Post subject: Length of Data using Broker Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi all,

How to get the data length after i set the OutputRoot.XML...... Is there a parameter in mq which counts for us? Thanks

Rgds.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Mon Jul 31, 2006 2:11 am    Post subject: Re: Length of Data using Broker Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi angka,

angka wrote:
How to get the data length after i set the OutputRoot.XML...... Is there a parameter in mq which counts for us?

In MB use LENGTH, In MQ use getMessageLength()

Is this what u wanted ?

Regards.
Back to top
View user's profile Send private message Send e-mail
angka
PostPosted: Mon Jul 31, 2006 2:16 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi elvis_gn,

Ya but thought it can only count OutputRoot.blob.blob. btw is there any additional value tt i need to minus off? thanks..
Back to top
View user's profile Send private message
angka
PostPosted: Mon Jul 31, 2006 2:58 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

Is there a way to count the whole OutputRoot.XML tree rather den counting each child eg LENGTH(OutputRoot.XML.Message.a)? thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jul 31, 2006 7:14 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can use ASBITSTREAM to flatten the data into a bitstream (a BLOB) and then do length of that.

Otherwise, you can't really even get this by walking the tree - because you won't get tag names in your lengths.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
angka
PostPosted: Tue Aug 01, 2006 1:31 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

Thanks alot.
Back to top
View user's profile Send private message
angka
PostPosted: Tue Sep 26, 2006 12:37 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

How do I calculate the data length for OutputRoot.MRM?

I tried using
SET Datalength = ASBITSTREAM(OutputRoot.MRM SET 'adf' TYPE 'fdfd' FORMAT 'CWF1');

Using this way, I only get the data length of the Custom Wired Format but not those MRM tags..
Thanks
Back to top
View user's profile Send private message
vinbud117
PostPosted: Tue Sep 26, 2006 12:52 am    Post subject: Reply with quote

Acolyte

Joined: 22 Jul 2005
Posts: 61

ASBITSTREAM gives the BLOB form of the input. CWF does not contain the tags, tht is y u get the length of only the data...
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Sep 26, 2006 5:32 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

There is only one reliable way to find the length of an output message. The method is the same whatever the domain.
1. Serialialize the message using ASBITSTREAM and save the result in a BLOB.
2. Get the length of the BLOB using the LENGTH function.

For CWF, it might be possible to do it by walking the tree and adding up the lengths. That will work sometimes, but it depends on the trimming and padding options on the individual fields. So if you want your message flow to be independent of your message set, I don't recommend that approach.
Back to top
View user's profile Send private message
angka
PostPosted: Tue Sep 26, 2006 6:06 pm    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

My input message body is of CWF then in my flow I parse it to MRM and after parsing, I try the following codes:

1)SET OUTPUT_DATA = ASBITSTREAM(OutputRoot.MRM);
2)SET DATA_LENGTH = LENGTH(OUTPUT_DATA);

after my 1st statement, I got the error "Invalid Wire format retreived". Since the flow has logically convert the CWF message to MRM why I can't convert it to BITSTREAM.

I tried this
1)SET OUTPUT_DATA = ASBITSTREAM(OutputRoot.XML);
2)SET DATA_LENGTH = LENGTH(OUTPUT_DATA);

it works for XML..

Kimbert: ya i want my message flow to be independent of my message set. Thanks
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Sep 27, 2006 12:25 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I try the following codes:

1)SET OUTPUT_DATA = ASBITSTREAM(OutputRoot.MRM);

So...how were you expecting the MRM parser to find the correct message set? Please search for ASBITSTREAM in this forum if you don't understand that question.
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 » Length of Data using Broker
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.