jbossfuse - Apache Camel, calling one route from another -


i have 2 routes in 1 camel context.

<camelcontext xmlns="http://camel.apache.org/schema/blueprint">         <propertyplaceholder location="classpath:facebook.properties"             id="properties" />         <route>             <from uri="jetty:http://0.0.0.0:8765/getlikes" />             <to uri="facebook" />         </route>          <route>             <from uri="facebook://userlikes?oauthappid={{oauthappid}}&amp;oauthappsecret={{oauthappsecret}}&amp;oauthaccesstoken={{oauthaccesstoken}}" />             <log message="the message contains ${body}" />         </route>     </camelcontext> 

in second route use facebook component. want call http://localhost:8765/getlikes , likes facebook second route get. first route cannot find second one

you have use components direct (http://camel.apache.org/direct) or seda (http://camel.apache.org/seda.html) this:

    <camelcontext xmlns="http://camel.apache.org/schema/blueprint">         <propertyplaceholder location="classpath:facebook.properties"             id="properties" />         <route>                             <from uri="jetty:http://0.0.0.0:8765/getlikes" />             <to uri="direct:facebook" />         </route>          <route>             <from uri="direct:facebook" />             <!-- maybe need set headers here -->             <to uri="facebook://userlikes?oauthappid={{oauthappid}}&amp;oauthappsecret={{oauthappsecret}}&amp;oauthaccesstoken={{oauthaccesstoken}}" />             <log message="the message contains ${body}" />         </route>     </camelcontext> 

this link http://camel.apache.org/how-to-use-camel-as-a-http-proxy-between-a-client-and-server.html can helpful too.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -