diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitTemplate.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitTemplate.java index 6376c5d3..88341c4e 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitTemplate.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitTemplate.java @@ -49,6 +49,7 @@ import com.rabbitmq.client.GetResponse; * @author Mark Pollack * @author Mark Fisher * @author Dave Syer + * @since 1.0 */ public class RabbitTemplate extends RabbitAccessor implements RabbitOperations { @@ -134,6 +135,14 @@ public class RabbitTemplate extends RabbitAccessor implements RabbitOperations { this.messageConverter = messageConverter; } + /** + * Set the {@link MessagePropertiesConverter} for this template. + */ + public void setMessagePropertiesConverter(MessagePropertiesConverter messagePropertiesConverter) { + Assert.notNull(messagePropertiesConverter, "messagePropertiesConverter must not be null"); + this.messagePropertiesConverter = messagePropertiesConverter; + } + /** * Return the message converter for this template. */ diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainer.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainer.java index 9a072e07..9425bff6 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainer.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainer.java @@ -51,6 +51,7 @@ import com.rabbitmq.client.Channel; * @author Mark Pollack * @author Mark Fisher * @author Dave Syer + * @since 1.0 */ public class SimpleMessageListenerContainer extends AbstractMessageListenerContainer { @@ -105,6 +106,22 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta private ContainerDelegate proxy = delegate; + + /** + * Default constructor for convenient dependency injection via setters. + */ + public SimpleMessageListenerContainer() { } + + /** + * Create a listener container from the connection factory (mandatory). + * + * @param connectionFactory the {@link ConnectionFactory} + */ + public SimpleMessageListenerContainer(ConnectionFactory connectionFactory) { + this.setConnectionFactory(connectionFactory); + } + + /** *
* Public setter for the {@link Advice} to apply to listener executions. If {@link #setTxSize(int) txSize>1} then @@ -130,20 +147,6 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta this.recoveryInterval = recoveryInterval; } - /** - * Default constructor for convenient dependency injection via setters. - */ - public SimpleMessageListenerContainer() { } - - /** - * Create a listener container from the connection factory (mandatory). - * - * @param connectionFactory the {@link ConnectionFactory} - */ - public SimpleMessageListenerContainer(ConnectionFactory connectionFactory) { - this.setConnectionFactory(connectionFactory); - } - /** * Specify the number of concurrent consumers to create. Default is 1. *
@@ -208,6 +211,14 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta this.transactionAttribute = transactionAttribute; } + /** + * Set the {@link MessagePropertiesConverter} for this listener container. + */ + public void setMessagePropertiesConverter(MessagePropertiesConverter messagePropertiesConverter) { + Assert.notNull(messagePropertiesConverter, "messagePropertiesConverter must not be null"); + this.messagePropertiesConverter = messagePropertiesConverter; + } + /** * Avoid the possibility of not configuring the CachingConnectionFactory in sync with the number of concurrent * consumers.