I have a camel cxf-rs endpoint that splits the requests into two main parts.
form("cxfrs:bean:rsServer")
.when(isForward()).to("cxfrs:http://example.com")
.otherwise().process(myCustomDispatcher) // i want to get rid of this custom dispatcher
The first part is straight forwarded to a different service.
For the second part i would like to dispatch/call classes/methods that have jaxrs annotation. Currently i have a custom processor myCustomerDispatcher
that duplicates the logic from the annotations and dispatches manually to classes and methods. Especially @Path
and @PathParams
are duplicated.
I tried:
to("bean:MyJaxRsImplemantion")
this will work for beans with a single method matching the parameters in the camel exchange, but does not consider jax-rs annotations.Serveral combinations with
to("cxfrs:bean:cxfEndpoint?resourceClasses=MyJaxRsImplemantion")
. it either requires a forwarding address, or acts on a new endpoint creating camel exchanges. I couldn't find a way to call the actual implementation.The ProduceTemplates all seem to handle singular paths or situations.
Question:
How can i write a camel route that actually calls jax-rs resource methods without forwarding to a new service?