Its always best to serialize objects going through AMQ into JSON, XML or
some other means. Not only does it reduce the problems of compatible JAR
files (because they would have to be the SAME jar files on both sides), it
also makes messages in the queue easier to read when that becomes
necessary. Although object messages are possible, they are fraught with
problems.

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
<http://www.linkedin.com/pub/robert-simmons/40/852/a39>*


On Thu, Feb 6, 2014 at 2:30 AM, Charles Moulliard <ch0...@gmail.com> wrote:

> If you would like to expose the logic using Camel, I would like to suggest
> that you place a CBR (http://camel.apache.org/content-based-router.html)
> before to call one the methods of your Bean depending which class type you
> receive from the Body - In.
>
>
> On Thu, Feb 6, 2014 at 9:15 AM, dbenitez <dbenite...@live.com> wrote:
>
> > Hello to all,
> >
> > I'm having problems with a camel Route in an important international
> > project, the matter is I have a camel route configured like this:
> >
> > <camelContext id="comunicationsCamelContext"
> > xmlns="http://camel.apache.org/schema/spring";>
> >
> >   <route id="receiverFromRoute" autoStartup="true">
> >      <from uri="activemq:queue:serviceEvaluationQueue" />
> >      <to uri="bean:receiverFromRt?method=receivingFromRt" />
> >  </route>
> >
> > </camelContext>
> >
> > And the receiver is like this:
> >
> > if(exchange.getIn().getBody() instanceof BbMasterOrderDTO){
> >    bbMasterOrder = (BbMasterOrderDTO) exchange.getIn().getBody();
> >
> > This is working well if I send messages with objects of the class
> > BbMasterOrderDTO inside, but the route is not consuming if I put other
> kind
> > of object inside the message body,
> >
> > My target is consuming all messages also if arrive an unexpected kind of
> > class inside of the message, because if not, I must remove manually the
> > messages inside the camel route...
> >
> > Thanks very much in advance
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Consuming-messages-with-casting-problems-tp5746880.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
> Charles Moulliard
> Apache Committer / Architect @RedHat
> Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io
>

Reply via email to