I would like to redirect the webservice request to the InOnly endpoint in the jms queue. Then forward the jms response message received from the individual InOnly endpoint back to the webservice client service as a response. The request / response webservice is a synchronous InOut template, and the sub-item is an asynchronous one. What options should I follow with Camel?
Camel route is used to explain my question:
String uri={webserice uri}
from(uri)
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
ServcieRequest req =
exchange.getIn().getBody(ServcieRequest.class);
ProducerTemplate template = exchange.getContext().createProducerTemplate();
template.sendBodyAndHeaders("jms:queue:INQueue", req.getPayload(), headers);
}});
from("jms:queue:OUTQueue")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
}});
James source
share