camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kraythe ." <kray...@gmail.com>
Subject Re: Consuming messages with casting problems
Date Thu, 06 Feb 2014 18:56:56 GMT
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 <ch007m@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 <dbenitez83@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
>

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