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 FUNCTION

Post new topic  Reply to topic Goto page Previous  1, 2
 LENGTH FUNCTION « View previous topic :: View next topic » 
Author Message
goldym
PostPosted: Tue Mar 13, 2007 7:58 am    Post subject: Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

[quote="goldym"]
jefflowrey wrote:
Read the message as BLOB, ask for the length of InputRoot.BLOB.BLOB and then parse the message as MRM...



Does you know how I would "parse the message as MRM or BLOB" in a java compute node?

I tried just asking for the length and then I was going to Parse as MRM and then insert the length into the length field.

Code:
MbElement blob = root.getFirstElementByPath("BLOB");
MbElement blobData = root.getFirstElementByPath("BLOB/BLOB");
            int i = (int) ((Blob) blobData).length();


but this gave me a ClassCastException.

So I tried bytes to string capture the length and insert it.

Code:
byte[] dataByteArray = (byte[])(blobData.getValue());
String dataString = new String(dataByteArray);
      
int imsgLength = dataString.length();
String smsgLength = String.valueOf(imsgLength);

int ilengthoflength = smsgLength.length();
String smsg = dataString.substring(0,6) + smsgLength + dataString.substring(8);
         
int inewmsgLength = smsg.length();
String snewLength = String.valueOf(inewmsgLength);
                  
String snewmsg = dataString.substring(0,6) + snewLength + dataString.substring(8);
byte[] newdatastring = (byte[])(snewmsg.getBytes());


However I am not sure how I parse the data to BLOB in order to propagate outAssemply? Any ideas?
Back to top
View user's profile Send private message
goldym
PostPosted: Tue Mar 13, 2007 9:16 am    Post subject: Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

[quote="goldym"]
goldym wrote:
jefflowrey wrote:
Read the message as BLOB, ask for the length of InputRoot.BLOB.BLOB and then parse the message as MRM...



Does you know how I would "parse the message as MRM or BLOB" in a java compute node?

I tried just asking for the length and then I was going to Parse as MRM and then insert the length into the length field.

Code:
MbElement blob = root.getFirstElementByPath("BLOB");
MbElement blobData = root.getFirstElementByPath("BLOB/BLOB");
            int i = (int) ((Blob) blobData).length();


but this gave me a ClassCastException.

So I tried bytes to string capture the length and insert it.

Code:
byte[] dataByteArray = (byte[])(blobData.getValue());
String dataString = new String(dataByteArray);
      
int imsgLength = dataString.length();
String smsgLength = String.valueOf(imsgLength);

int ilengthoflength = smsgLength.length();
String smsg = dataString.substring(0,6) + smsgLength + dataString.substring(8);
         
int inewmsgLength = smsg.length();
String snewLength = String.valueOf(inewmsgLength);
                  
String snewmsg = dataString.substring(0,6) + snewLength + dataString.substring(8);
byte[] newdatastring = (byte[])(snewmsg.getBytes());


However I am not sure how I parse the data to BLOB in order to propagate outAssemply? Any ideas?


resolved

Code:
blobData.setValue(snewmsg.getbytes());
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » LENGTH FUNCTION
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.