You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Thierry RABUEL <tr...@cora.fr> on 2014/07/28 14:54:13 UTC

Rép. : Failed to start route route2 because of Multiple consumers for the same endpoint is not allowed

Maybe should you have a look at the multicast EIP http://camel.apache.org/multicast.html

Sincerly,

Thierry

>>> Frankiboy <ma...@gmail.com> 28/07/14 11:43 >>>

I want to have the same message into two routes, but when i add number 2 i
get a error.

How to ?

My route:


     from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
       .onException(Exception.class).process(new LogError()).end()
       .filter().method(LogMq.class, "logStart")
       .to("activemq:topic:HUB_TOP01?selector=BD='YES'");



      from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
          .onException(Exception.class).process(new LogError()).end()
          .bean(AddIpBean.class)
          .recipientList().method(Util.class, "getEndpoint");

My camel.xml

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

    <bean id="bankconnectRoutes"
class="dk.bankconnect.hub.controller.CentralRouter" />
    
    
    <bean id="activemq" class="org.apache.camel.component.jms.JmsComponent">  
      <property name="connectionFactory">
        <bean class="com.ibm.mq.jms.MQConnectionFactory">  
             <property name="transportType" value="1"/>
             <property name="hostName" value="bdaix416.bdunet.dk"/>     
                <property name="port" value="1414"/>
                <property name="queueManager" value="HUB_T_416"/>
             <property name="channel" value="SYSTEM.DEF.SVRCONN"/> 
             <property name="CCSID" value="819"></property>
        </bean> 
      </property>
     </bean>
    

     <cxf:cxfEndpoint id="hubws" address="/CorporateService"
        xmlns="http://service.bankconnect.dk" wsdlURL="WEB-INF/bankconnect.wsdl"
/>  
    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <routeBuilder ref="bankconnectRoutes" />
        
        
    </camelContext>
</beans>


Exception:

 org.apache.camel.FailedToStartRouteException: Failed to start route route2
because of Multiple consumers for the same endpoint is not allowed:
Endpoint[cxf://bean:hubws?
dataFormat=MESSAGE]
      
Any ideas ?       

Frank  
 

       
      



--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-start-route-route2-because-of-Multiple-consumers-for-the-same-endpoint-is-not-allowed-tp5754511.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Rép. : Failed to start route route2 because of Multiple consumers for the same endpoint is not allowed

Posted by Frankiboy <ma...@gmail.com>.
My first endpoint is the recipientList, then i want to call LogMq.class , and
send a string back and go to my second endpoint activemq..

What is wrong here:


 I tryed this, but get exception:


  from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
      .multicast()
      .onException(Exception.class).process(new LogError()).end()
      .bean(AddIpBean.class)
      .recipientList().method(Util.class, "getEndpoint")
      .filter().method(LogMq.class, "logStart")
      .to("activemq:topic:HUB_TOP01?selector=BD='YES'");



ankConnectHub_war: org.apache.camel.RuntimeCamelException:
java.lang.IllegalArgumentException: The output must be added as top-level on
the route. Try moving OnException[[class java.lang.Exception] -> []] to the
top of route.



--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-start-route-route2-because-of-Multiple-consumers-for-the-same-endpoint-is-not-allowed-tp5754511p5754526.html
Sent from the Camel - Users mailing list archive at Nabble.com.