Hi
But can you have a single JAX-RS service implementation which simply
delegates to the Task ?
A CXF endpoint needs to have an implementation, for example, I
experimented with delegating the calls to Olingo recently:
https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/odata/src/main/java/odata/server/JaxrsODataService.java
So this becomes an OData server with the CXF code doing nothing but
preparing a call to the Olingo which actually does OData. So you can try
do something similar, have, as Andrei suggested, GET/POST/etc methods,
listening on the wildcard patterns and all delegating to a common code
which calls Task.
May be, alternatively, you can try Camel.
Cheers, Sergey
I wonder if Camel would fit better in this case,
On 11/01/18 11:01, Andrea Turli wrote:
Andrei,
thanks for your suggestions. I think I was looking at a way to avoid to
re-implement the Rest resources to delegate calls to the Task framework,
some kind of embedded mechanism to process all calls in the same way.
Maybe I should look at filters?
Thanks
On Thu, Jan 11, 2018 at 11:52 AM, Andrei Shakirin <[email protected]>
wrote:
Hi Andrea,
The invokers link you posted relates to JAX-WS (SOAP services)
implementation and not to JAX-RS (Rest services). There are custom invokers
in CXF JAX-RS as well (http://cxf.apache.org/docs/jax-rs-filters.html),
however they dedicated to pre or post process of main invocation.
As I far as I understand your use case, you would like to get incoming
REST call using CXF and delegate it to your Task Framework for further
processing.
In this case, I would simply create a CXF JAX-RS service with required
Rest interface (resources, HTTP methods, etc) and provide java
implementation for exposed Rest Resources delegating calls to your Task
Framework.
You can take this implementation as example:
https://github.com/apache/cxf/tree/master/distribution/src/
main/release/samples/jax_rs/basic/src/main/java/demo/jaxrs/server
Is it useful way for you?
Regards,
Andrei.
-----Original Message-----
From: Andrea Turli (apache.org) [mailto:[email protected]]
Sent: Mittwoch, 10. Januar 2018 15:15
To: [email protected]
Subject: Incoming message processing: filters, interceptors, invokers?
Hi,
Apache Brooklyn project uses CXF3.1.10 to implement the REST server in
front
of the Brooklyn core.
We want to execute each service method (i.e. the execution of each REST
api
call) in our Task Framework. We therefore want to be able to wrap up the
incoming restful calls to that method in a callable that is submitted to
the task
framework.
What would you recommend to use to achieve the above result? I'm
considering http://cxf.apache.org/docs/invokers.html, do you think it
is a good
start?
Any example would be appreciated, thanks!
Andrea