-
1. Re: REST services
davsclaus Jan 11, 2011 9:22 AM (in response to allanon76)Have you seen the developing REST guide
-
2. Re: REST services
allanon76 Jan 11, 2011 9:55 AM (in response to davsclaus)thank you for the response.
But I don't need to implement from scratch a new REST service.
I already have it exposed somewhere in the web and just want to expose it trough the the ESB....
-
3. Re: REST services
davsclaus Jan 11, 2011 10:31 AM (in response to allanon76)You want to proxy it? Then you can use a generic http service to proxy it.
With Camel you can do a simple route to proxy it:
fron("jetty:0.0.0.0:9123/myapp/mypath?bridgeEndpoint=true&throwExcpetionOnFailure=false").to("http:url_of_real_service?bridgeEndpoint =true&throwExcpetionOnFailure=false");
There is also a Camel CXF proxy example which may inspire you
-
4. Re: REST services
allanon76 Jan 12, 2011 11:38 AM (in response to davsclaus)Hi,
thank you for your suggestion.
I'm trying to do what you suggested but...
I'm using apache-servicemix-4.3.0-fuse-03-00
starting from camel-osgi-example from camel distribution I've configured the camelContext.xml as described at the end of this post. I added the dependency to camel-jetty 2.5.0 in the pom.xml. I built everything (mvn clean/compile/install)
The osgi bundle is correctly installed (without error in the servicemix log ):
but when I start it I've this error
Error executing command: The bundle "org.apache.camel.camel-example-osgi_2.4.0 [
395]" could not be resolved. Reason: Missing Constraint: Import-Package: org.apa
che.camel.component.jetty; version="[2.4.0,2.5.0)"
Any suggestion?
Is the camelContext below correct to proxy the http call?
Thanks in advance.
-
5. Re: REST services
davsclaus Jan 12, 2011 11:46 AM (in response to allanon76)You need to use features to install those Camel components
http://fusesource.com/docs/esb/4.3/esb_deploy_osgi/DeployFeatures.html
If you do a features:list you should see all the Camel components. Then install the camel-jetty feature
features:install camel-jetty
And also camel-cxf feature as well (if not already installed)
-
-
7. Re: REST services
ffang Jan 12, 2011 8:26 PM (in response to allanon76)Hi,
Yeah, this is a version issue, as FUSE ESB 4.3.0-fuse-03-00 use camel 2.4.0-fuse-02-00,
so you just need specify camel version as 2.4.0-fuse-02-00 in your example pom.xml
Freeman
-
8. Re: REST services
njiang Jan 12, 2011 11:32 PM (in response to allanon76)It could be better if you just have one version of camel-*. As there could have some difference between the camel-core 2.4.0-fuse-02-00 and camel-core 2.4.0-fuse-03-00.
Willem
-
9. Re: REST services
allanon76 Jan 13, 2011 12:03 PM (in response to ffang)Thanks a lot to all,
I tried in many ways to getting it to work.
But I'm unable to run it in fuse esb
I tried to modify the version, but in this way I've compile error even if I've the package in my local mvn repository and this means I cannot produce the final jar to be deployed in the ESB.
I'm a bit frustrated as this is just the start point of my project and I'm encountering lot of problem
-
10. Re: REST services
davsclaus Jan 13, 2011 2:28 PM (in response to allanon76)You should use the versions which is shipped with Fuse ESB as its been tested together to ensure they work together.
-
11. Re: REST services
allanon76 Jan 17, 2011 9:55 AM (in response to davsclaus)It works now.
Thanks to all.