-
1. Re: The best approach to consume resftFull service in camel ?
davsclaus Jul 8, 2015 2:14 AM (in response to bharadwaj)I am afraid for CXF you would have to upgrade to JBoss Fuse 6.2 to get Camel 2.15.
For fuse 6.1 you can look at camel-restlet which can do rest services (its a bit different than Apache CXF).
-
2. Re: The best approach to consume resftFull service in camel ?
eminkevich Aug 3, 2015 6:49 PM (in response to bharadwaj)Hi, bharadwaj,
We run 2.12 with CXF RS service endpoint imported into Camel context.
The endpoint is declared in a class:
public class RestInterface {
@GET
@Path("/{projectCode}/{subjectCode}")
@Produces(MediaType.APPLICATION_JSON)
public Response processRequest(@PathParam("projectCode") String projectCode, @PathParam("subjectCode") String requestCode) {
return null;
}
}
And then it is exposed to camel as:
<camelcxf:rsServer id="rsServer" address="https://localhost:9292/rest/solution/v1" staticSubresourceResolution="true"
serviceClass="com.company.RestInterface"
loggingFeatureEnabled="false" loggingSizeLimit="20">
<camelcxf:providers>
<ref component-id="authenticationFilter"/>
<ref component-id="authorizationFilter"/>
</camelcxf:providers>
</camelcxf:rsServer>
And camel context can access params:
<log message="REQUEST : $simple{in.header.projectCode}/$simple{in.header.subjectCode}" loggingLevel="DEBUG" logName="REST-INTERFACE"/>
Let me know if the question is still valid I will prepare a fully blown template for you.