diff --git a/build.gradle b/build.gradle index 84542a21df..e80994a8c9 100644 --- a/build.gradle +++ b/build.gradle @@ -109,7 +109,7 @@ subprojects { subproject -> slf4jVersion = "1.7.6" smack3Version = '3.2.1' smackVersion = '4.0.0' - springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '1.3.4.RELEASE' + springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '1.3.5.BUILD-SNAPSHOT' springDataMongoVersion = '1.5.0.RELEASE' springDataRedisVersion = '1.3.0.RELEASE' springGemfireVersion = '1.4.0.RELEASE' diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AbstractAmqpInboundAdapterParser.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AbstractAmqpInboundAdapterParser.java index 5b6d248dab..d967ef0005 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AbstractAmqpInboundAdapterParser.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AbstractAmqpInboundAdapterParser.java @@ -53,7 +53,8 @@ abstract class AbstractAmqpInboundAdapterParser extends AbstractSingleBeanDefini "recovery-interval", "receive-timeout", "shutdown-timeout", - "tx-size" + "tx-size", + "missing-queues-fatal" }; private static final String[] CONTAINER_REFERENCE_ATTRIBUTES = { diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java index f501116595..3a1b79df8c 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java @@ -124,6 +124,8 @@ public class AmqpChannelFactoryBean extends AbstractFactoryBean getObjectType() { return (this.channel != null) ? this.channel.getClass() : AbstractAmqpChannel.class; @@ -406,6 +412,9 @@ public class AmqpChannelFactoryBean extends AbstractFactoryBean + + + + + If 'true', and none of the queues are available on the broker, the container will throw a fatal exception during + startup and will stop if the queues are deleted when the container is running (after making 3 attempts to + passively declare the queues). If false, the container will not throw an exception and go into recovery mode, + attempting to restart according to the 'revcovery-interval'. Default 'true'. + + + + + + + diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests-context.xml b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests-context.xml index 8ef78cf2bb..0855ea5a6e 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests-context.xml +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests-context.xml @@ -17,7 +17,7 @@ - + diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests.java b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests.java index 2d7f72fc61..4cd44986a7 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests.java +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpChannelParserTests.java @@ -17,7 +17,9 @@ package org.springframework.integration.amqp.config; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; import java.util.List; @@ -57,6 +59,7 @@ public class AmqpChannelParserTests { Object mbf = context.getBean(IntegrationUtils.INTEGRATION_MESSAGE_BUILDER_FACTORY_BEAN_NAME); assertSame(mbf, TestUtils.getPropertyValue(channel, "dispatcher.messageBuilderFactory")); assertSame(mbf, TestUtils.getPropertyValue(channel, "container.messageListener.messageBuilderFactory")); + assertTrue(TestUtils.getPropertyValue(channel, "container.missingQueuesFatal", Boolean.class)); } @Test @@ -64,6 +67,7 @@ public class AmqpChannelParserTests { MessageChannel channel = context.getBean("channelWithSubscriberLimit", MessageChannel.class); assertEquals(1, TestUtils.getPropertyValue( TestUtils.getPropertyValue(channel, "dispatcher"), "maxSubscribers", Integer.class).intValue()); + assertFalse(TestUtils.getPropertyValue(channel, "container.missingQueuesFatal", Boolean.class)); } diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpInboundChannelAdapterParserTests-context.xml b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpInboundChannelAdapterParserTests-context.xml index 20dd75ac81..0776c62616 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpInboundChannelAdapterParserTests-context.xml +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/AmqpInboundChannelAdapterParserTests-context.xml @@ -22,7 +22,7 @@ + auto-startup="false" phase="123" acknowledge-mode="${ackMode}" missing-queues-fatal="false" /> Optional (Defaults to 5000). + + If 'true', and none of the queues are available on the broker, the container + will throw a fatal exception during startup and will stop if the queues are deleted when + the container is running (after making 3 attempts to passively declare the queues). If false, + the container will not throw an exception and go into recovery mode, attempting to restart according + to the revcovery-interval. + Optional (Defaults to true). + The time to wait for workers in milliseconds after the underlying SimpleMessageListenerContainer diff --git a/src/reference/docbook/whats-new.xml b/src/reference/docbook/whats-new.xml index 3621d4d8f1..88135c7b4e 100644 --- a/src/reference/docbook/whats-new.xml +++ b/src/reference/docbook/whats-new.xml @@ -11,7 +11,14 @@
General Changes -
+
+ AMQP Inbound Endpoints, Channel + + Elements that utilize a message listener container (inbound endpoints, channel) + now support the missing-queues-fatal attribute. + See for more information. + +
AMQP Outbound Endpoints The AMQP outbound endpoints support a new property lazy-connect