Hi,
I use camel-cxfrs with a JAX-RS2 resource java class having a method declared
in async way using AsyncResponse, like this:
<camel:route>
<camel:from
uri="cxfrs://bean://testRsServer?bindingStyle=SimpleConsumer" />
.........a code here that finally does
exchange.getOut().setBody(response);
</camel:route>
<camelcxf:rsServer id="testRsServer" address="/test"
serviceClass="foo.bar.TestResource">
@Path("/") @Produces({MediaType.APPLICATION_JSON})
public class TestResource {
@POST @Path("/something")
public void addAccount(@Multipart(value = "myDomainObject") final
String myDomainObject, @Suspended final AsyncResponse ar) {
throw new RuntimeException("Camel does not call it anyway");
}
}
When I invoke the resource, Camel invokes the route, however no REST response
is sent back to client for some reason... Looks like Camel is not calling
AsyncResponse.resume()?
If I change the resource declaration to sync-way like below, i.e. drop
AsyncResponse and change response type from void to MyResponse, then REST
response is sent back as expected.
@POST @Path("/something")
public MyResponse addAccount(@Multipart(value = "myDomainObject") final
String myDomainObject) {
throw new RuntimeException("Camel does not call it anyway");
}
Why is such behavior? Am I missing something?
--
Best regards