You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jh0331 <jh...@att.com> on 2010/11/04 20:44:23 UTC

MessageConverter Example

Does anyone have a MessageConverter example handy?  I am having problems
getting this to work...  

There are a few existing posts on this topic, but none with clear answers /
guidance.

thanks!
jon
-- 
View this message in context: http://camel.465427.n5.nabble.com/MessageConverter-Example-tp3250752p3250752.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: MessageConverter Example

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Nov 4, 2010 at 8:44 PM, jh0331 <jh...@att.com> wrote:
>
> Does anyone have a MessageConverter example handy?  I am having problems
> getting this to work...
>
> There are a few existing posts on this topic, but none with clear answers /
> guidance.
>

Check the unit test source code.


> thanks!
> jon
> --
> View this message in context: http://camel.465427.n5.nabble.com/MessageConverter-Example-tp3250752p3250752.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: MessageConverter Example

Posted by Christian Müller <ch...@gmail.com>.
Or do you mean the Camel type converter? See
http://camel.apache.org/type-converter.html

Christian

Re: MessageConverter Example

Posted by Richard Kettelerij <ri...@gmail.com>.
By "messageConverter" do you mean the messageConverter option of the JMS
component (http://camel.apache.org/jms.html)? Or do you mean something else?

-----
Richard Kettelerij,
http://github.com/rkettelerij
-- 
View this message in context: http://camel.465427.n5.nabble.com/MessageConverter-Example-tp3250752p3250769.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: MessageConverter Example

Posted by Claus Ibsen <cl...@gmail.com>.
See
ConsumeMessageConverterTest
ProduceMessageConverterTest

in the camel-jms unit tests


On Fri, Nov 5, 2010 at 5:32 PM, jh0331 <jh...@att.com> wrote:
>
> yes, I meant the messageConverter option of the JMS component.
>
> I looked in the unit test source, and I see no tests that utilize
> MessageConverter.  perhaps I have overlooked them?
>
> let me explain why I am asking...
>
> basically, I have a cbridge route bridging a weblogic queue to a websphere
> mq queue.  on the weblogic side, a header element is being inserted called
> JMS_BEA_RedeliveryLimit.  here is an example:
>
> 05 Nov 2010 11:47:54,998[MESSAGE :]Exchange[Id:ID:<587743.1288971857951.0>,
> Properties:{CamelBinding=org.apache.camel.component.jms.JmsBinding@98d70d,
> CamelToEndpoint=log://Bridge?showBody=false&showExchangeId=true&showHeaders=true&showProperties=true},
> Headers:{JMSRedelivered=true, JMSType=null, JMSExpiration=0,
> JMSTimestamp=1288971857951, JMSCorrelationID=null,
> JMSMessageID=ID:<587743.1288971857951.0>,
> JMSDestination=server-jms!RequestBridgeQueue, JMSXDeliveryCount=8,
> JMSPriority=4, JMSXGroupID=null, JMSDeliveryMode=2, JMSReplyTo=null,
> JMS_BEA_RedeliveryLimit=10}, BodyType:String]
>
> mq related code is generating the following error:
>
> Caused by: com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0050:
> The property name 'JMS_BEA_RedeliveryLimit' is reserved and cannot be set.
> The supplied property name begins with the JMS prefix, but is not one of the
> supported, settable properties. Check the property name and correct errors.
>
> so I was thinking I could create a MessageConverter, and remove that header
> property before the message is passed to websphere.  does this approach make
> sense?
>
> I have not been able to get the following approach working as mentioned on
> the JMS Component page:
>
> from("file://inbox/order").to("jms:queue:order?messageConverter=#myMessageConverter");
>
> I was able to trigger my message converter in a junit by manually creating
> the components and starting routes without the notation specified above, but
> this approach is not working on live system yet.  also, I don't really want
> to manually create the components, instead relying on camel context and
> scanner to automatically set everything up...
>
> any advice is appreciated.
>
> thanks!
> jon
>
>
> jh0331 wrote:
>>
>> Does anyone have a MessageConverter example handy?  I am having problems
>> getting this to work...
>>
>> There are a few existing posts on this topic, but none with clear answers
>> / guidance.
>>
>> thanks!
>> jon
>>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/MessageConverter-Example-tp3250752p3252112.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: MessageConverter Example

Posted by jh0331 <jh...@att.com>.
yes, I meant the messageConverter option of the JMS component.

I looked in the unit test source, and I see no tests that utilize
MessageConverter.  perhaps I have overlooked them?

let me explain why I am asking...  

basically, I have a cbridge route bridging a weblogic queue to a websphere
mq queue.  on the weblogic side, a header element is being inserted called
JMS_BEA_RedeliveryLimit.  here is an example:

05 Nov 2010 11:47:54,998[MESSAGE :]Exchange[Id:ID:<587743.1288971857951.0>,
Properties:{CamelBinding=org.apache.camel.component.jms.JmsBinding@98d70d,
CamelToEndpoint=log://Bridge?showBody=false&showExchangeId=true&showHeaders=true&showProperties=true},
Headers:{JMSRedelivered=true, JMSType=null, JMSExpiration=0,
JMSTimestamp=1288971857951, JMSCorrelationID=null,
JMSMessageID=ID:<587743.1288971857951.0>,
JMSDestination=server-jms!RequestBridgeQueue, JMSXDeliveryCount=8,
JMSPriority=4, JMSXGroupID=null, JMSDeliveryMode=2, JMSReplyTo=null,
JMS_BEA_RedeliveryLimit=10}, BodyType:String]

mq related code is generating the following error:

Caused by: com.ibm.msg.client.jms.DetailedMessageFormatException: JMSCC0050:
The property name 'JMS_BEA_RedeliveryLimit' is reserved and cannot be set.
The supplied property name begins with the JMS prefix, but is not one of the
supported, settable properties. Check the property name and correct errors.

so I was thinking I could create a MessageConverter, and remove that header
property before the message is passed to websphere.  does this approach make
sense?

I have not been able to get the following approach working as mentioned on
the JMS Component page:

from("file://inbox/order").to("jms:queue:order?messageConverter=#myMessageConverter");

I was able to trigger my message converter in a junit by manually creating
the components and starting routes without the notation specified above, but
this approach is not working on live system yet.  also, I don't really want
to manually create the components, instead relying on camel context and
scanner to automatically set everything up...

any advice is appreciated.

thanks!
jon


jh0331 wrote:
> 
> Does anyone have a MessageConverter example handy?  I am having problems
> getting this to work...  
> 
> There are a few existing posts on this topic, but none with clear answers
> / guidance.
> 
> thanks!
> jon
> 

-- 
View this message in context: http://camel.465427.n5.nabble.com/MessageConverter-Example-tp3250752p3252112.html
Sent from the Camel - Users mailing list archive at Nabble.com.