INT-1795 the default receiveTimeout for a JmsTemplate used by an 'inbound-channel-adapter' (polling consumer) is now set to: JmsTemplate.RECEIVE_TIMEOUT_NO_WAIT. The value can be explicitly overridden via the 'receive-timeout' attribute

This commit is contained in:
Mark Fisher
2011-04-29 14:27:41 -04:00
parent 763d70d4ff
commit b59bdc0d70

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@ import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.util.StringUtils;
/**
@@ -124,7 +125,13 @@ abstract class JmsAdapterParserUtils {
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "priority");
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "delivery-persistent");
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "explicit-qos-enabled");
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "receive-timeout");
String receiveTimeout = element.getAttribute("receive-timeout");
if (StringUtils.hasText(receiveTimeout)) {
builder.addPropertyValue("receiveTimeout", receiveTimeout);
}
else {
builder.addPropertyValue("receiveTimeout", JmsTemplate.RECEIVE_TIMEOUT_NO_WAIT);
}
Integer acknowledgeMode = parseAcknowledgeMode(element, parserContext);
if (acknowledgeMode != null) {
builder.addPropertyValue("sessionAcknowledgeMode", acknowledgeMode);