On Sat, Aug 20, 2011 at 6:01 PM, Robert Dare <[email protected]> wrote:
> How does one go about using character/text  body types instead of
> object in Camel routes?  Is it as simple as just setting a string in
> the producer template?
>
> The ActiveMQ docs indicate that object body types are lowest performance.
>

Can you provide a bit more details what you want to do? It sounds as
if you want to route messages from Camel to a ActiveMQ queue.
And that you want to use a javax.jms.TextMessage as the JMS message type?

The Camel JMS endpoint has an option to control that, its the
jmsMessageType option. You can read about it here:
http://camel.apache.org/jms

Here is an example:
.to("activemq:queue:foo?jmsMessageType=Text")


And yes you can also convert the message body to a String type
beforehand as well using the Type Converters
http://camel.apache.org/type-converter.html

.convertBodyTo(String.class)
.to("activemq:queue:foo")

Also there is data format that can convert between types
http://camel.apache.org/data-format


> Thank you.
>
> Rob
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to