camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: JMSMessage into camel
Date Mon, 05 Nov 2007 12:50:54 GMT
On 03/11/2007, Koen Serry <> wrote:
> Hi I'm trying something basic here and so far I haven't found anything on the
> site/unittests/forums. This is my case:
> Another application is putting a MapMessage onto a queue. I'd like Camel to
> take it off (no problem there), but to be usable as a Exchange object I
> think I need some kind of conversion. My first 2 guesses are JmsBinding or
> AsyncProcessorTypeConverter, but I have no clue how I should attach it into
> my router.
> I've created a small senderTest that does just the same thing (MapMessage
> that is, to simulate the behaviour and I get the same thing). Strange thing
> is if I create a ObjectMessage with a Map as object it does work.
> so origin is in other app
> MapMessage msg = session.createMapMessage();
> msg.setString("type", type.getCode());
> and in my processor I'd like to have access to it
> exchange.getIn().getBody() -> Both ObjectMessage and MapMessage return a
> Map, but in the latter it is empty.

This turns out to be a bug :). The
JmsBinding.createMapFromMapMessage() had a schoolboy error - using the
headers rather than the MapMessage values when creating the Map.

I've added a test case and fixed the bug - see
ConsumeJmsMapMessageTest. So if you try building trunk (or using
tomorrows SNAPSHOT distro) things should work correctly. Namely that
you should be able to send a Map in an ObjectMessage or as a
MapMessage on JMS and be able to consume them in Camel and see a
populated Map object.


Open Source SOA

View raw message