Since I can't reproduce your issue, would you mind doing up a test case and attaching it to a JIRA issue? That will speed up the process of fixing this.

selezovikj wrote:
I don't think that there is a problem with Camel, because when I try running
my application with having my routes written in the Java DSL, WITHOUT using
the multicast keyword, every queue of the static recipient list successfully
receives the message. The problem occurs, when I define the routing in Spring. When I don't use the multicast keyword, only the first queue receives the message. When I use the multicast keyword, none of the queue receives the message. Errors:
org.apache.camel.RuntimeCamelException:
org.apache.camel.component.jms.RuntimeJmsException: Failed to extract body
due to: javax.jms.JMSException: Failed to build body from bytes. Reason:
java.io.IOException

Caused by: javax.jms.JMSException: Failed to build body from bytes. Reason:
java.io.IOException



janstey wrote:
Yeah, 1.5 hasn't been released yet so its still changing quite a bit. But this may be a bug in Camel 1.4.

By the way, in my test I used the activemq component rather that the jms component to send to queues. So, something like this:

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:amq="http://activemq.apache.org/schema/core";
       xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd";>

<broker xmlns="http://activemq.apache.org/schema/core"; useJmx="false" persistent="false">
    <transportConnectors>
      <transportConnector uri="tcp://localhost:61616" />
    </transportConnectors>
  </broker>

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL" value="tcp://localhost:61616"/>
  </bean>

  <camelContext xmlns="http://activemq.apache.org/camel/schema/spring";>
    <package>org.apache.camel.testmulticast</package>
    <route>
      <from uri="activemq:tempqueue"/>
      <multicast>
        <to uri="activemq:personnel.records1"/>
<to uri="activemq:personnel.records2"/> </multicast> </route> ...
selezovikj wrote:
I am running ActiveMQ 5.1.0 and Camel 1.4.
I thought that Camel 1.5 was not stable


janstey wrote:
I was just running a test with ActiveMQ 5.1.0 and Camel 1.5-SNAPSHOT and all seems to work fine. Whats your JMS broker/version and Camel version?

selezovikj wrote:
I actually tested the Java DSL and it works without the "multicast"
keyword.
In the camel DSL, without using the multicast keyword it only send to
Queue1. When I use the multicast keyword it does not send to any queues. And it gives an error like: Can't build body from bytes.
Error at
org.apache.camel.component.jms.JmsBinding.extractBodyFromJms(JmsBinding.java:97)

Do you have any idea why is this so ?


janstey wrote:
Actually, looks like the docs are a bit misleading. If you want the
same
message routed to all destinations, you'll need to wrap the outputs in
a
multicast element

<route>
  <from uri="jms:numbers"/>
  <multicast>
    <to uri="jms:Queue1"/>
    <to uri="jms:Queue2"/>
    <to uri="jms:Queue3"/>
  </multicast>
</route>

and also modify your Java DSL to

from("jms:numbers").multicast().to("jms:queue:Queue1",
"jms:queue:Queue2",
"jms:queue:Queue3");





Reply via email to