Results 1 to 3 of 3

Thread: Working with Messages

  1. #1
    Join Date
    Nov 2006
    Posts
    193

    Default 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

  2. #2
    Join Date
    Nov 2006
    Posts
    193

    Default

    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.

  3. #3
    Join Date
    Nov 2006
    Posts
    193

    Default

    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
  •