Class RabbitTemplateConfigurer
java.lang.Object
org.springframework.boot.amqp.autoconfigure.RabbitTemplateConfigurer
Configure
RabbitTemplate
with sensible defaults tuned using configuration
properties.
Can be injected into application code and used to define a custom
RabbitTemplate
whose configuration is based upon that produced by
auto-configuration.
- Since:
- 4.0.0
- Author:
- Stephane Nicoll, Yanming Zhou
-
Constructor Summary
ConstructorsConstructorDescriptionRabbitTemplateConfigurer
(RabbitProperties rabbitProperties) Creates a new configurer that will use the givenrabbitProperties
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(org.springframework.amqp.rabbit.core.RabbitTemplate template, org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory) Configure the specifiedRabbitTemplate
.protected RetryTemplate
createRetryTemplate
(RabbitProperties.Retry properties) protected final RabbitProperties
void
setMessageConverter
(@Nullable org.springframework.amqp.support.converter.MessageConverter messageConverter) Set theMessageConverter
to use ornull
if the out-of-the-box converter should be used.void
setRetrySettingsCustomizers
(@Nullable List<RabbitTemplateRetrySettingsCustomizer> retrySettingsCustomizers) Set theRabbitTemplateRetrySettingsCustomizer
instances to use.
-
Constructor Details
-
RabbitTemplateConfigurer
Creates a new configurer that will use the givenrabbitProperties
.- Parameters:
rabbitProperties
- properties to use
-
-
Method Details
-
setMessageConverter
public void setMessageConverter(@Nullable org.springframework.amqp.support.converter.MessageConverter messageConverter) Set theMessageConverter
to use ornull
if the out-of-the-box converter should be used.- Parameters:
messageConverter
- theMessageConverter
-
setRetrySettingsCustomizers
public void setRetrySettingsCustomizers(@Nullable List<RabbitTemplateRetrySettingsCustomizer> retrySettingsCustomizers) Set theRabbitTemplateRetrySettingsCustomizer
instances to use.- Parameters:
retrySettingsCustomizers
- the retry settings customizers
-
getRabbitProperties
-
configure
public void configure(org.springframework.amqp.rabbit.core.RabbitTemplate template, org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory) Configure the specifiedRabbitTemplate
. The template can be further tuned and default settings can be overridden.- Parameters:
template
- theRabbitTemplate
instance to configureconnectionFactory
- theConnectionFactory
to use
-
createRetryTemplate
-