You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Koen Serry <ko...@hotmail.com> on 2007/11/03 10:35:20 UTC
JMSMessage into camel
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.
Thanks in advance,
Koen
--
View this message in context: http://www.nabble.com/JMSMessage-into-camel-tf4742340s22882.html#a13561259
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JMSMessage into camel
Posted by James Strachan <ja...@gmail.com>.
On 05/11/2007, Koen Serry <ko...@hotmail.com> wrote:
>
> Thanks a bunch, I see now getPropertyNames instead of getMapNames :) in
> JmsBinding
You mean the other way around right? :)
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com
Re: JMSMessage into camel
Posted by Koen Serry <ko...@hotmail.com>.
Thanks a bunch, I see now getPropertyNames instead of getMapNames :) in
JmsBinding
James.Strachan wrote:
>
> On 03/11/2007, Koen Serry <ko...@hotmail.com> 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.
>
> https://issues.apache.org/activemq/browse/CAMEL-205
>
> 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.
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source SOA
> http://open.iona.com
>
>
--
View this message in context: http://www.nabble.com/JMSMessage-into-camel-tf4742340s22882.html#a13592795
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JMSMessage into camel
Posted by James Strachan <ja...@gmail.com>.
On 03/11/2007, Koen Serry <ko...@hotmail.com> 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.
https://issues.apache.org/activemq/browse/CAMEL-205
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.
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com
Re: JMSMessage into camel
Posted by Hiram Chirino <hi...@hiramchirino.com>.
On 11/3/07, Koen Serry <ko...@hotmail.com> 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
Hi, I think you Should be able to do a:
JmsMessage in = (JmsMessage)exchange.getIn();
MapMessage = (MapMessage)in.getJmsMessage()
> Map, but in the latter it is empty.
>
>
>
> Thanks in advance,
> Koen
> --
> View this message in context: http://www.nabble.com/JMSMessage-into-camel-tf4742340s22882.html#a13561259
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
--
Regards,
Hiram
Blog: http://hiramchirino.com