-
Apr 15th, 2009, 10:58 AM
#1
Working with Messages
Hi all,
Ok, so I got my MQ setup and I put a few messages on the Q. I then use SI to pull a message off and write it away as a Blob in the DB. I know need to select the Blob and extract the XML message. Can someone please assist with the easiest way to do this.
many thanx
-
Apr 16th, 2009, 05:31 AM
#2
just to clarify, I have selected the Blob into a GenericMessage object. How does one extract the original XML from the object? I've checked the docs for working with the Message object but dont really find anything that points me in the right direction, anyone got some advice?
Last edited by dudleygb; Apr 16th, 2009 at 05:35 AM.
-
Apr 16th, 2009, 06:19 AM
#3
now i feel stupid, I've done this before on another project
simply a Message Object holds a payload. In my case, here is how I get my payload from an MQ message
public <T extends Serializable> void getPayloadAsString(Message<T> inMessage)
{
byte[] msg = (byte[]) inMessage.getPayload();
String out = new String(msg);
sLog.info(out.toString());
}
Simple as that!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules