Hello,

An alternative would be to implement your own message converter and add it
to the activemq uri. See the jms component page. You will then be handed
the session and I think this will save you alot of work.

Best regards
Pontus
Den 2 aug 2012 08:37 skrev "Henryk Konsek" <[email protected]>:

> Hi Brent,
>
> > Is it possible to create a custom DataFormat to translate a message into
> a
> > BlobMessage?
>
> Sure it is.
>
> a) Create you data format implementing org.apache.camel.spi.DataFormat
> interface.
> b) Add ActiveMQConnectionFactory as your DataFormat member (you will
> need it to create session used to create BlobMessage)
> c) Implement marshal/unmarshal methods in your data format.
> d) Add it to your route.
>
> The resulting route could look like:
>
> DataFormat blobDataFormat = new BlobDataFormat(activeMQConnectionFactory);
> from("direct:binary").unmarshall(blobDataFormat).to(...)
> from("direct:blob").marshall(blobDataFormat).to(...)
>
> However I'm not sure how ActiveMQ component handles BlobMessages
> passed to it, so I can't tell you if your data format will work well
> with existing Camel ActiveMQ support.
>
> Best regards.
>
> --
> Henryk Konsek
> http://henryk-konsek.blogspot.com
>

Reply via email to