You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jprio <je...@gmail.com> on 2012/08/23 19:04:24 UTC

Routing an ObjectMessage in ActiveMQ

Hello,
I'm using AMQ 5.5.0 and I want to use the following route definition to
route an *ObjectMessage* :

 <route>
    <from uri="activemq:queue:foo?jmsMapMessage=false"/>
    <to uri="activemq:queue:bar1"/>
    <to uri="activemq:queue:bar2"/>
  </route>

My problem is that, when I post an ObjectMessage to foo, the consumer of
bar1 receives an ActivemqObjectMessage whereas the consumer of bar2 receives
an ActivemqMessage (and not an ActivemqObjectMessage).


I tried : 

 <route>
    <from uri="activemq:queue:foo?jmsMapMessage=false"/>
    <multicast>
    <to uri="activemq:queue:bar1"/>
    <to uri="activemq:queue:bar2"/>
    </multicast>
  </route>

but then I have an ActivemqMessage in bar1 and in bar2.

What can I do to receive an ActivemqObjectMessage both in bar1 and in bar2.

Thanx for your help.




--
View this message in context: http://camel.465427.n5.nabble.com/Routing-an-ObjectMessage-in-ActiveMQ-tp5717965.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Routing an ObjectMessage in ActiveMQ

Posted by Matthieu Vincent <mv...@gmail.com>.
Thanks Christian for the hint, I'll have a look at it.

I found a workaround yesterday, as server and client know entities I've
switched my messages to BytesMessage and it did the trick.

Regards,
Matthieu


2013/3/18 Christian Müller <ch...@gmail.com>

> Try stream caching as described here:
> http://camel.apache.org/stream-caching.html
>
> Best,
> Christian
>
> On Mon, Mar 18, 2013 at 4:15 PM, yodamad <mv...@gmail.com> wrote:
>
> > Hi,
> >
> >  I'm facing the same problem using camel 2.8 in servicemix 4.4.1.
> > Does anyone find a solution for this "issue" ?
> >
> > Thanks
> > Mat
> >
> >
> >
> > --
> > View this message in context:
> >
> http://camel.465427.n5.nabble.com/Routing-an-ObjectMessage-in-ActiveMQ-tp5717965p5729353.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
>

Re: Routing an ObjectMessage in ActiveMQ

Posted by Christian Müller <ch...@gmail.com>.
Try stream caching as described here:
http://camel.apache.org/stream-caching.html

Best,
Christian

On Mon, Mar 18, 2013 at 4:15 PM, yodamad <mv...@gmail.com> wrote:

> Hi,
>
>  I'm facing the same problem using camel 2.8 in servicemix 4.4.1.
> Does anyone find a solution for this "issue" ?
>
> Thanks
> Mat
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Routing-an-ObjectMessage-in-ActiveMQ-tp5717965p5729353.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--

Re: Routing an ObjectMessage in ActiveMQ

Posted by yodamad <mv...@gmail.com>.
Hi,

 I'm facing the same problem using camel 2.8 in servicemix 4.4.1.
Does anyone find a solution for this "issue" ?

Thanks
Mat



--
View this message in context: http://camel.465427.n5.nabble.com/Routing-an-ObjectMessage-in-ActiveMQ-tp5717965p5729353.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Routing an ObjectMessage in ActiveMQ

Posted by jprio <je...@gmail.com>.
Charles,
Thank you for your answer.
I tried your proposal. If I remove the '?jmsMapMessage=false' and I sent an
ActiveMQTextMessage to 'foo' then I do receive an ActiveMQTextMessage in
bar1 AND in bar2 (with jmsMapMessage=false, I receive an ActiveMQMessage).
So I guess it should work with my ObjectMessage also, but then the pb is
that I would have to put the class of the transfered object in the classpath
of AMQ (I don't wan't that) to avoid a 'Failed to build body from content.
Serializable class not available to broker'.



--
View this message in context: http://camel.465427.n5.nabble.com/Routing-an-ObjectMessage-in-ActiveMQ-tp5717965p5717987.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Routing an ObjectMessage in ActiveMQ

Posted by Charles Moulliard <ch...@gmail.com>.
Hi Jean-Pierre,

Have you the same issue if you draw your camel route like this :

 <route>
    <from uri="activemq:queue:foo"/>
    <multicast>
    <to uri="activemq:queue:bar1"/>
    <to uri="activemq:queue:bar2"/>
    </multicast>
  </route>

Regards,



On Thu, Aug 23, 2012 at 7:04 PM, jprio <je...@gmail.com> wrote:

> Hello,
> I'm using AMQ 5.5.0 and I want to use the following route definition to
> route an *ObjectMessage* :
>
>  <route>
>     <from uri="activemq:queue:foo?jmsMapMessage=false"/>
>     <to uri="activemq:queue:bar1"/>
>     <to uri="activemq:queue:bar2"/>
>   </route>
>
> My problem is that, when I post an ObjectMessage to foo, the consumer of
> bar1 receives an ActivemqObjectMessage whereas the consumer of bar2
> receives
> an ActivemqMessage (and not an ActivemqObjectMessage).
>
>
> I tried :
>
>  <route>
>     <from uri="activemq:queue:foo?jmsMapMessage=false"/>
>     <multicast>
>     <to uri="activemq:queue:bar1"/>
>     <to uri="activemq:queue:bar2"/>
>     </multicast>
>   </route>
>
> but then I have an ActivemqMessage in bar1 and in bar2.
>
> What can I do to receive an ActivemqObjectMessage both in bar1 and in bar2.
>
> Thanx for your help.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Routing-an-ObjectMessage-in-ActiveMQ-tp5717965.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Sr. Pr. Consultant at FuseSource.com
Twitter : @cmoulliard
Blog : http://cmoulliard.blogspot.com

Re: Routing an ObjectMessage in ActiveMQ

Posted by Claus Ibsen <cl...@gmail.com>.
I would assume that when sending a object then AMQ uses a a stream to
contain the data. And that stream is possible not re-readable when you
send the message to the 2nd destination.

AMQ itself have ways of auto forwarding messages, so you can have AMQ
send to bar2, when you send to bar1.
I am not sure though, you would possible have to debug to see what goes on.



On Thu, Aug 23, 2012 at 7:04 PM, jprio <je...@gmail.com> wrote:
> Hello,
> I'm using AMQ 5.5.0 and I want to use the following route definition to
> route an *ObjectMessage* :
>
>  <route>
>     <from uri="activemq:queue:foo?jmsMapMessage=false"/>
>     <to uri="activemq:queue:bar1"/>
>     <to uri="activemq:queue:bar2"/>
>   </route>
>
> My problem is that, when I post an ObjectMessage to foo, the consumer of
> bar1 receives an ActivemqObjectMessage whereas the consumer of bar2 receives
> an ActivemqMessage (and not an ActivemqObjectMessage).
>
>
> I tried :
>
>  <route>
>     <from uri="activemq:queue:foo?jmsMapMessage=false"/>
>     <multicast>
>     <to uri="activemq:queue:bar1"/>
>     <to uri="activemq:queue:bar2"/>
>     </multicast>
>   </route>
>
> but then I have an ActivemqMessage in bar1 and in bar2.
>
> What can I do to receive an ActivemqObjectMessage both in bar1 and in bar2.
>
> Thanx for your help.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Routing-an-ObjectMessage-in-ActiveMQ-tp5717965.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen