Most of our unit tests use the servicemix client for sending messages,
and lots of them in a synchronous way. So there must be something in your
application that causes this behavior.
Could you provide a simple test case / main so that i can check this ?
Cheers,
Guillaume Nodet
Craig Walls wrote:
I have a client that sends a message like this:
InOut exchange = serviceMixClient.createInOutExchange();
NormalizedMessage message = exchange.getInMessage();
exchange.setService(new QName("myService"));
message.setProperty("someProperty", "someValue");
message.setContent(new StringSource("<question>How are you?</question>"));
serviceMixClient.sendSync(exchange);
NormalizedMessage result = exchange.getOutMessage();
On the service-side, my onMessageExchange() method looks a little
something like this:
public void onMessageExchange(MessageExchange exchange) throws
MessagingException {
NormalizedMessage out = exchange.createMessage();
out.setContent(new StringSource("<answer>I am fine</answer>"));
message.setMessage(out, "out"); // PAY ATTENTION
done(exchange); // TO THESE LINES
}
In ServiceMix 1.1, this worked fine. But since moving to ServiceMix 2.0, I
get an error indicating that I can't set the status to done. Fine, so I
swapped out the commented lines above with:
message.setMessage(out, "out");
send(exchange);
Now my sendSync() never returns. On a hunch, I tried this instead:
answer(exchange, out);
Same effect. onMessageExchange() method completes on the service-side, but
on the client-side, the sendSync() method never returns.
I'm certain that it's something that I'm doing wrong, but I'm not sure
what. Anybody see the problem? Please help!