AMQP-173 added setters for the MessagePropertiesConverter strategy on RabbitTemplate as well as SimpleMessageListenerContainer
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 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.
|
||||
* <p>
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user