user219882
user219882

Reputation: 15844

Is it possible to create a synchronnous response with CXF server and Camel which processes the request?

I would like to have a REST web service using Apache CXF and send incomming requests to a camel:route for processing. Is it possible to create a response synchronnously (if a error during the processing occurs) from the route or not?

Upvotes: 0

Views: 158

Answers (1)

Christian Schneider
Christian Schneider

Reputation: 19626

Yes. In fact this is the default. You can either use camel-cxf to trigger the route or use a direct endpoint to send something into the route.

With the direct endpoint you would do the following:

producer = camelContext.createProducerTemplate();

try {

result = producer.requestBody("direct:test", myContent);

} catch (Exception e) { ... }

The respective route then would have to start with:

from("direct:test")...

Upvotes: 1

Related Questions