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:
@@ -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()) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user