public class RabbitGatewaySupport extends Object implements InitializingBean
Requires a ConnectionFactory or a RabbitTemplate instance to be set.
It will create its own RabbitTemplate if a ConnectionFactory is passed in.
A custom RabbitTemplate instance can be created for a given ConnectionFactory
through overriding the createRabbitTemplate(org.springframework.amqp.rabbit.connection.ConnectionFactory)
method.
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses
|
Constructor and Description |
---|
RabbitGatewaySupport() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected RabbitTemplate |
createRabbitTemplate(ConnectionFactory connectionFactory)
Create a RabbitTemplate for the given ConnectionFactory.
|
ConnectionFactory |
getConnectionFactory()
Return the Rabbit ConnectionFactory used by the gateway.
|
RabbitTemplate |
getRabbitTemplate()
Return the RabbitTemplate for the gateway.
|
protected void |
initGateway()
Subclasses can override this for custom initialization behavior.
|
void |
setConnectionFactory(ConnectionFactory connectionFactory)
Set the Rabbit connection factory to be used by the gateway.
|
void |
setRabbitTemplate(RabbitTemplate rabbitTemplate)
Set the RabbitTemplate for the gateway.
|
protected final org.apache.commons.logging.Log logger
public final void setConnectionFactory(ConnectionFactory connectionFactory)
connectionFactory
- createRabbitTemplate(org.springframework.amqp.rabbit.connection.ConnectionFactory)
,
setConnectionFactory(org.springframework.amqp.rabbit.connection.ConnectionFactory)
protected RabbitTemplate createRabbitTemplate(ConnectionFactory connectionFactory)
connectionFactory
- the Rabbit ConnectionFactory to create a RabbitTemplate forsetConnectionFactory(org.springframework.amqp.rabbit.connection.ConnectionFactory)
public final ConnectionFactory getConnectionFactory()
public final void setRabbitTemplate(RabbitTemplate rabbitTemplate)
rabbitTemplate
- setConnectionFactory(org.springframework.amqp.rabbit.connection.ConnectionFactory)
public final RabbitTemplate getRabbitTemplate()
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException
afterPropertiesSet
in interface InitializingBean
IllegalArgumentException
BeanInitializationException