You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Frankiboy <ma...@gmail.com> on 2014/07/30 12:53:25 UTC

Same messages to 2 endpoints ?

     
      This is my routes:

       from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching() 
      .onException(Exception.class).process(new LogError()).end() 
      .to("direct:channel1", "direct:channel2");  
        
       from("direct:channel1")
      .setHeader("BD", constant("YES"))
      .setHeader("JMS_IBM_Format", constant("MQSTR"))
      .bean(LogMq.class, "logStart")
      .inOnly("activemq:topic:HUB_TOP01");
             
       from("direct:channel2")
      .bean(AddIpBean.class) 
      .recipientList().method(Util.class, "getEndpoint");

I newer get to my AddIpBean.class, i get call inOnly, the MQ log is OK , bug
the (LogMq.class, "logStart")class returns a String "Frank was here from
LogMq" and then this exception:

 javax.xml.ws.soap.SOAPFaultException: Exception occurred during execution
on the exchange: Exchange[Message: Frank was here from LogMq]

I want to start channel1 and channel2 with same input.....

Frank 


    



--
View this message in context: http://camel.465427.n5.nabble.com/Same-messages-to-2-endpoints-tp5754637.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Same messages to 2 endpoints ?

Posted by Frankiboy <ma...@gmail.com>.
Thanks , that was the way to do it 

 from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
      .onException(Exception.class).process(new LogError()).end() 
      .multicast()
      .to("direct:channel1", "direct:channel2");  
 
       from("direct:channel1")
      .setHeader("BD", constant("YES"))
      .setHeader("JMS_IBM_Format", constant("MQSTR"))
      .bean(LogMq.class, "logStart")
      .inOnly("activemq:topic:HUB_TOP01");
             
       from("direct:channel2")
      .bean(AddIpBean.class) 
      .recipientList().method(Util.class, "getEndpoint");



--
View this message in context: http://camel.465427.n5.nabble.com/Same-messages-to-2-endpoints-tp5754637p5754646.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Same messages to 2 endpoints ?

Posted by Michael Leuthold <mi...@gmail.com>.
I think you'll need to put a mutlicast() before calling the endpoints
as suggested - otherwise the direct Endpoints will be called in the
order, passing the Out from the first as the In to the other.

See http://camel.apache.org/multicast.html for further reference.



On Wed, Jul 30, 2014 at 12:53 PM, Frankiboy <ma...@gmail.com> wrote:
>
>       This is my routes:
>
>        from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
>       .onException(Exception.class).process(new LogError()).end()
>       .to("direct:channel1", "direct:channel2");
>
>        from("direct:channel1")
>       .setHeader("BD", constant("YES"))
>       .setHeader("JMS_IBM_Format", constant("MQSTR"))
>       .bean(LogMq.class, "logStart")
>       .inOnly("activemq:topic:HUB_TOP01");
>
>        from("direct:channel2")
>       .bean(AddIpBean.class)
>       .recipientList().method(Util.class, "getEndpoint");
>
> I newer get to my AddIpBean.class, i get call inOnly, the MQ log is OK , bug
> the (LogMq.class, "logStart")class returns a String "Frank was here from
> LogMq" and then this exception:
>
>  javax.xml.ws.soap.SOAPFaultException: Exception occurred during execution
> on the exchange: Exchange[Message: Frank was here from LogMq]
>
> I want to start channel1 and channel2 with same input.....
>
> Frank
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Same-messages-to-2-endpoints-tp5754637.html
> Sent from the Camel - Users mailing list archive at Nabble.com.