You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by florian M <fl...@gmail.com> on 2008/12/01 16:34:22 UTC
Re: Trying to route http msg with camel
Hi,
Thanks for the help !!
Ashwin Karpe wrote:
>
> There is a simpler way to do this via the servicemix-camel component.
> Please refer to the camel example in the servicemix installation under
> <install-dir>/examples/cam
>
In serviceMix 3.3.1.11 I can't find any example really different from what I
did. There is just a camelContext bean in all examples, with a package, or
routing rules inside like this :
<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
<package>org.bridge.camel.su.MyRouteBuilder</package>
</camelContext>
I tried to remove jbi component declaration (yes I took it from the
servicemix-camel example of apache) I had on my xml file to match these
examples, but I can't find any service or endpoint declaration example.
Ashwin Karpe wrote:
>
> You could try changing this to "camel:camel" where the camel context is
> listed.
>
I tried but I still don't know how to make routing. I don't understand the
role of the tracker endpoint at
http://servicemix.apache.org/servicemix-camel.html servicemix camel example
and why it references a #tracker bean...
So maybe I've misunderstood : to route from a service unit like http to
another using camel I need a registered camel service with an endpoint to
route to from the http consumer, right ? (we can't deploy an http su without
specifying a target service or endpoint).
I read documentation, I understand the architecture but the implementation
is not clear to me. Can someone give me a small explanation please ?
Thanks, Florian
--
View this message in context: http://www.nabble.com/Trying-to-route-http-msg-with-camel-tp20722508p20774220.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Trying to route http msg with camel
Posted by Ashwin Karpe <as...@progress.com>.
Hi Florian,
In order to route from an HTTP-SU, you need to do the following
a> in your camel xbean.xml where you have defined a route, you need to
set up a jbi listener endpoint as follows
<route>
<from
uri="jbi:endpoint:http://mynamespace/myhttpservicelistener/endpoint"/>
<to uri="jbi:endpoint:http://mynamespace/mySMXBeanService/endpoint"/>
</route>
Alternatively you could choose not use an HTTP-SU at all and do this
directly in the servicemix-camel route as follows
<route>
<from uri="http://www.mywebsite.com/myhttpservicename/endpoint"/>
<to uri="jbi:endpoint:http://mynamespace/mySMXBeanService/endpoint"/>
</route>
b> If you choose to use the HTTP SU then point the target service and
target endpoint to the listener you have set up in camel as follows
<http:endpoint service="mynamespace:MyHTTPService"
endpoint="endpoint"
role="consumer"
targetService="mynamespace:myhttpservicelistener"
targetEndpoint="endpoint"
locationURI="http://www.mywebsite.com/myhttpservicename/endpoint"
defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />
Hope this helps.
Cheers,
Ashwin...
P.S: If you have prolonged trouble with this please email me at
askarpe@progress.com and I will mail you a working example that may not
exactly the thing you are looking for but pretty close.
florian M wrote:
>
> Hi,
>
> Thanks for the help !!
>
>
> Ashwin Karpe wrote:
>>
>> There is a simpler way to do this via the servicemix-camel component.
>> Please refer to the camel example in the servicemix installation under
>> <install-dir>/examples/cam
>>
>
> In serviceMix 3.3.1.11 I can't find any example really different from what
> I did. There is just a camelContext bean in all examples, with a package,
> or routing rules inside like this :
>
> <camelContext id="camel"
> xmlns="http://activemq.apache.org/camel/schema/spring">
> <package>org.bridge.camel.su.MyRouteBuilder</package>
> </camelContext>
>
> I tried to remove jbi component declaration (yes I took it from the
> servicemix-camel example of apache) I had on my xml file to match these
> examples, but I can't find any service or endpoint declaration example.
>
>
> Ashwin Karpe wrote:
>>
>> You could try changing this to "camel:camel" where the camel context is
>> listed.
>>
>
> I tried but I still don't know how to make routing. I don't understand the
> role of the tracker endpoint at
> http://servicemix.apache.org/servicemix-camel.html servicemix camel
> example and why it references a #tracker bean...
>
> So maybe I've misunderstood : to route from a service unit like http to
> another using camel I need a registered camel service with an endpoint to
> route to from the http consumer, right ? (we can't deploy an http su
> without specifying a target service or endpoint).
>
> I read documentation, I understand the architecture but the implementation
> is not clear to me. Can someone give me a small explanation please ?
>
> Thanks, Florian
>
>
-----
---
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
---
+1-972-304-9084 (Office)
+1-972-971-1700 (Mobile)
----
Blog: http://opensourceknowledge.blogspot.com/
--
View this message in context: http://www.nabble.com/Trying-to-route-http-msg-with-camel-tp20722508p20774489.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.