You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christian Schneider <ch...@die-schneider.net> on 2011/01/07 17:38:27 UTC
Sending serialized object instead of BeanInvocation through pojo
producing
Hi all,
I would like to send an object to a jms queue using camel.
While I know I can do:
@EndpointInject(uri="jms:foo.bar")
ProducerTemplate producer;
producer.sendBody(book);
The problem with the above code is that I have camel in the business logic. So I would like to use an interface like:
public interface BookListener {
void onBook(Book book);
}
@Produce("jms:foo.bar")
BookListener bookListener;
bookListener.onBook(book);
When I do this I send a BeanInvocation to the jms queue. Is it possible to only send the jaxb serialized object ?
Thanks
Christian
--
----
http://www.liquid-reality.de
Re: Sending serialized object instead of BeanInvocation through
pojo producing
Posted by MarkD <ma...@googlemail.com>.
Is this possible now? I couldn't find a JIRA that looked like it stemmed from
here.
--
View this message in context: http://camel.465427.n5.nabble.com/Sending-serialized-object-instead-of-BeanInvocation-through-pojo-producing-tp3332114p5720811.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Sending serialized object instead of BeanInvocation through pojo producing
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jan 7, 2011 at 5:38 PM, Christian Schneider
<ch...@die-schneider.net> wrote:
> Hi all,
>
> I would like to send an object to a jms queue using camel.
> While I know I can do:
>
> @EndpointInject(uri="jms:foo.bar")
> ProducerTemplate producer;
>
> producer.sendBody(book);
>
> The problem with the above code is that I have camel in the business logic.
> So I would like to use an interface like:
>
> public interface BookListener {
> void onBook(Book book);
> }
>
> @Produce("jms:foo.bar")
> BookListener bookListener;
>
> bookListener.onBook(book);
>
> When I do this I send a BeanInvocation to the jms queue. Is it possible to
> only send the jaxb serialized object ?
>
No its not possible currently. The BeanInvocation is a serialized
object and the JMS producer is capable of sending objects and thus
sends that. What we need is an option on the JMS producer to send the
parameter instead. In your case its okay as there is only 1 parameter.
But if the onBook method had 2+ parameters it wouldn't be possible, as
which parameter should it send?
Create a JIRA ticket and we can take a look at this.
> Thanks
>
> Christian
>
>
>
> --
> ----
> http://www.liquid-reality.de
>
>
--
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/