camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pontus Ullgren <ullg...@gmail.com>
Subject Re: Is it possible to create a custom DataFormat to translate a message into a BlobMessage?
Date Thu, 02 Aug 2012 06:54:15 GMT
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" <hekonsek@gmail.com>:

> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message