Added support for the 'expect-reply' attribute in JmsGatewayParser. SimpleMessagingGateway now returns void instead of boolean, but it throws a MessageDeliveryException if the underlying RequestReplyTemplate fails to send the Message to the request channel.

This commit is contained in:
Mark Fisher
2008-05-14 14:38:58 +00:00
parent 2b8b4f5a7e
commit 18d03ae2d7
3 changed files with 10 additions and 5 deletions

View File

@@ -109,7 +109,7 @@ public class JmsGateway extends SimpleMessagingGateway implements Lifecycle, Dis
}
MessageListenerAdapter listener = new MessageListenerAdapter();
listener.setDelegate(this);
listener.setDefaultListenerMethod(this.expectReply ? "request" : "send");
listener.setDefaultListenerMethod(this.expectReply ? "sendAndReceive" : "send");
listener.setMessageConverter(this.messageConverter);
this.container.setMessageListener(listener);
if (!this.container.isActive()) {

View File

@@ -102,6 +102,9 @@ public class JmsGatewayParser extends AbstractSingleBeanDefinitionParser {
if (StringUtils.hasText(replyTimeout)) {
builder.addPropertyValue("replyTimeout", Long.parseLong(replyTimeout));
}
if ("true".equals(element.getAttribute("expect-reply"))) {
builder.addPropertyValue("expectReply", Boolean.TRUE);
}
}
}