I have a SOAP client component that I am hooking up like this:
from("queue:requests").to("soap.client:http://a.b.c:80/soap-service");
from("soap.client:http://a.b.c:80/soap-service").to("queue.responses");
(This is part of a bigger flow that is pulling in messages from a socket and
putting them in the request queue, then looking at the responses and making
decisions about eg. getting more messages.)
The way I have gotten this to work is to make something that implements
Consumer<Exchange>, Producer<Exchange>, saves the processor from
createConsumer(), and does this:
public void process(Exchange exchange) {
Message in = exchange.getIn();
Object request = in.getBody();
Object response = clientPort.someOperation(request); //call the
SOAP
service here
Exchange exchange2 = endpoint.createExchange();
Message out = exchange2.getIn();
out.setBody(response);
processor.process(exchange2);
}
This all works, but it can't be right. What happened to getOut() for the
first exchange? I't just ignored here.
Surely I'm missing the intended way to use these components.
--
View this message in context:
http://www.nabble.com/-camel--How-to-use-consumers-producers-tf3607252s2354.html#a10078142
Sent from the ActiveMQ - User mailing list archive at Nabble.com.