You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by newbiee <m_...@hotmail.com> on 2012/03/02 03:09:09 UTC
passing byte array
My route is something like this:
<from uri="timer://myTimer?fixedRate=true&period=600000" />
<setBody><constant>C08005005472C0</constant></setBody>
......................
The message is suppose to be sent as a byte array. Whereas I am sending it
as a string. How can I set the body to the byte array.
Thank you
--
View this message in context: http://camel.465427.n5.nabble.com/passing-byte-array-tp5529863p5529863.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: passing byte array
Posted by Ashwin Karpe <ak...@fusesource.com>.
HI,
For more detail check out the following links
http://camel.apache.org/convertbodyto.html
http://camel.apache.org/convertbodyto.html
http://camel.apache.org/type-converter.html
http://camel.apache.org/type-converter.html
Cheers,
Ashwin...
-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com
Blog: http://opensourceknowledge.blogspot.com
---------------------------------------------------------
--
View this message in context: http://camel.465427.n5.nabble.com/passing-byte-array-tp5529863p5529898.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: passing byte array
Posted by Ashwin Karpe <ak...@fusesource.com>.
Hi,
Here is how to do it
<route>
<from uri="direct:in"/>
<setBody><constant>C08005005472C0</constant></setBody>
<convertBodyTo type="java.lang.byte[]" charset="utf-16"/>
<to uri="mock:out"/>
</route>
The endpoint mock:out should receive a byte[]...
Hope this helps.
Cheers,
Ashwin...
-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com
Blog: http://opensourceknowledge.blogspot.com
---------------------------------------------------------
--
View this message in context: http://camel.465427.n5.nabble.com/passing-byte-array-tp5529863p5529896.html
Sent from the Camel - Users mailing list archive at Nabble.com.