JBoss Community

How to access message body of an aggregated message?

created by Derek Croxton in Beginner's Corner - View the full discussion

We're using a StreamingAggregator to put several messages together, but after they're recombined, we need to extract each original body and recombine them in a different way.  It looks like the StreamingAggregator combines the message bodies in a Mapor something similar, because the results of message.getBody().get() show something like:  {0=xxx,1=yyy}.

 

Unfortunately, I am unable to retrieve the body as an object where I could easily get the separate messages out.  Message.getBody() is a BodyImpl object and can't be case to a MapBody or ObjectBody.  Message.getBody().get() returns a string and can't be cast to anything else easily, as far as I can tell.

 

I hope there is some way to retrieve the original message bodies.  I can't just split the string on the comma because there are embedded commas in the data.  Any suggestions?

 

Derek

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community