From 2401d7e83c39c795ed425ab08825780e2425e2fb Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Thu, 18 Aug 2011 16:38:16 -0400 Subject: [PATCH] inbound-gateway now supports all attributes --- .../AbstractAmqpInboundAdapterParser.java | 1 + .../AmqpInboundChannelAdapterParser.java | 1 - .../config/spring-integration-amqp-2.1.xsd | 580 +++++++++--------- .../amqp/config/EchoSample-context.xml | 4 +- .../src/test/resources/log4j.properties | 1 + 5 files changed, 281 insertions(+), 306 deletions(-) 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 a68e5fe6b7..3ba3b0dd4d 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 @@ -100,6 +100,7 @@ abstract class AbstractAmqpInboundAdapterParser extends AbstractSingleBeanDefini } IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "message-converter"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "header-mapper"); + IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "error-channel"); this.configureChannels(element, parserContext, builder); } diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpInboundChannelAdapterParser.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpInboundChannelAdapterParser.java index 04d3d71a07..f4df79f62c 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpInboundChannelAdapterParser.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpInboundChannelAdapterParser.java @@ -38,7 +38,6 @@ public class AmqpInboundChannelAdapterParser extends AbstractAmqpInboundAdapterP @Override protected void configureChannels(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "channel", "outputChannel"); - IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "error-channel"); } } diff --git a/spring-integration-amqp/src/main/resources/org/springframework/integration/amqp/config/spring-integration-amqp-2.1.xsd b/spring-integration-amqp/src/main/resources/org/springframework/integration/amqp/config/spring-integration-amqp-2.1.xsd index da94e9636f..fb2b1fe52e 100644 --- a/spring-integration-amqp/src/main/resources/org/springframework/integration/amqp/config/spring-integration-amqp-2.1.xsd +++ b/spring-integration-amqp/src/main/resources/org/springframework/integration/amqp/config/spring-integration-amqp-2.1.xsd @@ -84,251 +84,22 @@ - - - - Unique ID for this adapter. - - - - - - - Acknowledge Mode for the MessageListenerContainer. - - - - - - - - - - - - - - - - - - Array of AOP Advice instances to be applied to the MessageListener. - - - - - - - + + + + + Message Channel to which converted Messages should be sent. - - - - - - - - - - - - Flag to indicate that channels created by this component will be transactional. - - - - - - - Specify the number of concurrent consumers to create. Default is 1. - Raising the number of concurrent consumers is recommended in order to scale the consumption of messages coming in - from a queue. However, note that any ordering guarantees are lost once multiple consumers are registered. In - general, stick with 1 consumer for low-volume queues. - - - - - - - - - - - - - - - - Message Channel to which error Messages should be sent. - - - - - - - - - - - - - Set whether to expose the listener Rabbit Channel to a registered ChannelAwareMessageListener as well as - to RabbitTemplate calls. - - - - - - - - HeaderMapper to use when receiving AMQP Messages. - - - - - - - - - - - - Reference to the MessageListener container to use for receiving AMQP Messages. If this attribute is provided, - then no other attribute related to the listener container configuration should be provided. In other words, by - setting this reference, you must take full responsibility of the listener container configuration. The only - exception is the MessageListener itself. Since that is actually the core responsibility of this Channel Adapter - implementation, the referenced listener container must NOT already have its own MessageListener configured. - - - - - - - - - - - - MessageConverter to use when receiving AMQP Messages. - - - - - - - - - - - - MessagePropertiesConverter to use when receiving AMQP Messages. - - - - - - - - - - - - - The lifeycle phase determining the start/stop order of the underlying listener container. - - - - - - - - - Specifies how many messages to send to each consumer in a single request. Often this can be set quite high - to improve throughput. It should be greater than or equal to the tx-size value. - - - - - - - - Names of the AMQP Queues from which Messages should be consumed (comma-separated list). - - - - - - - - The timeout for each attempt by a consumer to receive the next message. - - - - - - - - - The interval between recovery attempts, in milliseconds. The default is 5000 ms, that is, 5 seconds. - - - - - - - - - The time to wait for workers in milliseconds after the container is stopped, and before the connection is forced closed. - - - - - - - - - How many messages to process in a single transaction (if the channel is transactional). For best results it should be - less than or equal to the prefetch count. - - - - - - - - - Reference to the Executor to be used for running Consumer threads. - - - - - - - - - - - - The TransactionAttribute to use when the Consumer receives the AMQP Message and the Listener is invoked - within a transaction. This is only applicable when a TransactionManager has been configured. - - - - - - - - - - - - The PlatformTransactionManager to use when the Consumer receives the AMQP Message and the Listener is invoked. - - - - - - - + + + + + + + + + + @@ -421,73 +192,276 @@ - - - - Unique ID for this adapter. - - - - - - + + + + + Message Channel to which converted Messages should be sent. - - - - - - - - - - - + + + + + + + + + + + Message Channel where reply Messages will be expected. - - - - - - - - - - + + + + + + + + + + + + + + + + + Base type for the 'inbound-channel-adapter' and 'inbound-gateway' elements. + + + + + + Unique ID for this adapter. + + + + + + + Acknowledge Mode for the MessageListenerContainer. + + + + + + + + + + + + + + + + - Names of the AMQP Queues from which Messages should be consumed (comma-separated list). + Array of AOP Advice instances to be applied to the MessageListener. - - - - - + + + + + + + Flag to indicate that AMQP channels created by this component will be transactional. + + + + + + Specify the number of concurrent consumers to create. Default is 1. Raising the number of concurrent consumers is recommended in order to scale the consumption of messages coming in from a queue. However, note that any ordering guarantees are lost once multiple consumers are registered. In general, stick with 1 consumer for low-volume queues. + + + + + + + + + + + + + + + + Message Channel to which error Messages should be sent. + + + + + + + + + + + + + Set whether to expose the listener Rabbit Channel to a registered ChannelAwareMessageListener as well as + to RabbitTemplate calls. - - - - - - - - - - - - - - - - - - - - - - + + + + + + + HeaderMapper to use when receiving AMQP Messages. + + + + + + + + + + + + Reference to the MessageListener container to use for receiving AMQP Messages. If this attribute is provided, + then no other attribute related to the listener container configuration should be provided. In other words, by + setting this reference, you must take full responsibility of the listener container configuration. The only + exception is the MessageListener itself. Since that is actually the core responsibility of this Channel Adapter + implementation, the referenced listener container must NOT already have its own MessageListener configured. + + + + + + + + + + + + MessageConverter to use when receiving AMQP Messages. + + + + + + + + + + + + MessagePropertiesConverter to use when receiving AMQP Messages. + + + + + + + + + + + + + The lifeycle phase determining the start/stop order of the underlying listener container. + + + + + + + + + Specifies how many messages to send to each consumer in a single request. Often this can be set quite high + to improve throughput. It should be greater than or equal to the tx-size value. + + + + + + + + Names of the AMQP Queues from which Messages should be consumed (comma-separated list). + + + + + + + + The timeout for each attempt by a consumer to receive the next message. + + + + + + + + + The interval between recovery attempts, in milliseconds. The default is 5000 ms, that is, 5 seconds. + + + + + + + + + The time to wait for workers in milliseconds after the container is stopped, and before the connection is forced closed. + + + + + + + + + How many messages to process in a single transaction (if the channel is transactional). For best results it should be + less than or equal to the prefetch count. + + + + + + + + + Reference to the Executor to be used for running Consumer threads. + + + + + + + + + + + + The TransactionAttribute to use when the Consumer receives the AMQP Message and the Listener is invoked + within a transaction. This is only applicable when a TransactionManager has been configured. + + + + + + + + + + + + The PlatformTransactionManager to use when the Consumer receives the AMQP Message and the Listener is invoked. + + + + + + + + diff --git a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/EchoSample-context.xml b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/EchoSample-context.xml index 797ebd320a..a29800f6bf 100644 --- a/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/EchoSample-context.xml +++ b/spring-integration-amqp/src/test/java/org/springframework/integration/amqp/config/EchoSample-context.xml @@ -3,7 +3,7 @@ xmlns:beans="http://www.springframework.org/schema/beans" xmlns:amqp="http://www.springframework.org/schema/integration/amqp" xmlns:console="http://www.springframework.org/schema/integration/stream" xmlns:rabbit="http://www.springframework.org/schema/rabbit" xsi:schemaLocation="http://www.springframework.org/schema/integration/amqp http://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd - http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd + http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.1.xsd http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> @@ -27,7 +27,7 @@ queue-names="si.test.queue" connection-factory="connectionFactory" /> - + diff --git a/spring-integration-amqp/src/test/resources/log4j.properties b/spring-integration-amqp/src/test/resources/log4j.properties index dcc21d1995..00374b1b95 100644 --- a/spring-integration-amqp/src/test/resources/log4j.properties +++ b/spring-integration-amqp/src/test/resources/log4j.properties @@ -4,6 +4,7 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n +log4j.category.test=DEBUG log4j.category.org.springframework=WARN log4j.category.org.springframework.amqp=WARN log4j.category.org.springframework.integration.amqp=WARN