Class TestRabbitTemplate
- java.lang.Object
-
- org.springframework.amqp.rabbit.connection.RabbitAccessor
-
- org.springframework.amqp.rabbit.core.RabbitTemplate
-
- org.springframework.amqp.rabbit.test.TestRabbitTemplate
-
- All Implemented Interfaces:
java.util.EventListener,org.springframework.amqp.core.AmqpTemplate,org.springframework.amqp.core.MessageListener,org.springframework.amqp.rabbit.connection.PublisherCallbackChannel.Listener,org.springframework.amqp.rabbit.core.RabbitOperations,org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener,org.springframework.amqp.rabbit.support.ListenerContainerAware,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>,org.springframework.context.Lifecycle
public class TestRabbitTemplate extends org.springframework.amqp.rabbit.core.RabbitTemplate implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>ARabbitTemplatethat invokes@RabbitListeners directly. It currently only supports the queue name in the routing key. It does not currently support publisher confirms/returns.- Since:
- 2.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.springframework.amqp.rabbit.core.RabbitTemplate
org.springframework.amqp.rabbit.core.RabbitTemplate.ConfirmCallback, org.springframework.amqp.rabbit.core.RabbitTemplate.ReturnCallback, org.springframework.amqp.rabbit.core.RabbitTemplate.ReturnsCallback, org.springframework.amqp.rabbit.core.RabbitTemplate.TemplateConsumer
-
-
Constructor Summary
Constructors Constructor Description TestRabbitTemplate(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.amqp.core.MessagedoSendAndReceiveWithFixed(java.lang.String exchange, java.lang.String routingKey, org.springframework.amqp.core.Message message, org.springframework.amqp.rabbit.connection.CorrelationData correlationData)voidonApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)protected voidsendToRabbit(com.rabbitmq.client.Channel channel, java.lang.String exchange, java.lang.String routingKey, boolean mandatory, org.springframework.amqp.core.Message message)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)protected booleanuseDirectReplyTo()-
Methods inherited from class org.springframework.amqp.rabbit.core.RabbitTemplate
addAfterReceivePostProcessors, addBeforePublishPostProcessors, addListener, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertAndSend, convertMessageIfNecessary, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceive, convertSendAndReceiveAsType, convertSendAndReceiveAsType, convertSendAndReceiveAsType, convertSendAndReceiveAsType, convertSendAndReceiveAsType, convertSendAndReceiveAsType, convertSendAndReceiveAsType, convertSendAndReceiveAsType, convertSendAndReceiveAsType, convertSendAndReceiveAsType, convertSendAndReceiveAsType, convertSendAndReceiveRaw, correlationConvertAndSend, destroy, determineConfirmsReturnsCapability, doReceiveNoWait, doSend, doSendAndReceive, doSendAndReceiveWithTemporary, doStart, doStop, execute, expectedQueueNames, getAfterReceivePostProcessors, getEncoding, getExchange, getMessageConverter, getMessagePropertiesConverter, getRoutingKey, getUnconfirmed, getUnconfirmedCount, getUUID, handleConfirm, handleReturn, handleReturn, initDefaultStrategies, invoke, isChannelLocallyTransacted, isConfirmListener, isMandatoryFor, isReturnListener, isRunning, isUsePublisherConnection, nullSafeExchange, nullSafeRoutingKey, onMessage, onMessage, receive, receive, receive, receive, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndReply, receiveAndReply, receiveAndReply, receiveAndReply, receiveAndReply, receiveAndReply, removeAfterReceivePostProcessor, removeBeforePublishPostProcessor, replyTimedOut, revoke, send, send, send, send, send, sendAndReceive, sendAndReceive, sendAndReceive, sendAndReceive, sendAndReceive, sendAndReceive, setAfterReceivePostProcessors, setBeanFactory, setBeanName, setBeforePublishPostProcessors, setConfirmCallback, setConnectionFactory, setCorrelationDataPostProcessor, setCorrelationKey, setDefaultReceiveQueue, setEncoding, setExchange, setMandatory, setMandatoryExpression, setMandatoryExpressionString, setMessageConverter, setMessagePropertiesConverter, setNoLocalReplyConsumer, setReceiveConnectionFactorySelectorExpression, setReceiveTimeout, setRecoveryCallback, setReplyAddress, setReplyErrorHandler, setReplyTimeout, setRetryTemplate, setReturnCallback, setReturnsCallback, setRoutingKey, setSendConnectionFactorySelectorExpression, setTaskExecutor, setUseChannelForCorrelation, setUseDirectReplyToContainer, setUsePublisherConnection, setUserCorrelationId, setUserIdExpression, setUserIdExpressionString, setUseTemporaryReplyQueues, start, stop, waitForConfirms, waitForConfirmsOrDie
-
Methods inherited from class org.springframework.amqp.rabbit.connection.RabbitAccessor
afterPropertiesSet, convertRabbitAccessException, createConnection, getChannel, getConnection, getConnectionFactory, getTransactionalResourceHolder, isChannelTransacted, setChannelTransacted
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener
onMessageBatch
-
-
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-
useDirectReplyTo
protected boolean useDirectReplyTo()
- Overrides:
useDirectReplyToin classorg.springframework.amqp.rabbit.core.RabbitTemplate
-
sendToRabbit
protected void sendToRabbit(com.rabbitmq.client.Channel channel, java.lang.String exchange, java.lang.String routingKey, boolean mandatory, org.springframework.amqp.core.Message message)- Overrides:
sendToRabbitin classorg.springframework.amqp.rabbit.core.RabbitTemplate
-
doSendAndReceiveWithFixed
protected org.springframework.amqp.core.Message doSendAndReceiveWithFixed(java.lang.String exchange, java.lang.String routingKey, org.springframework.amqp.core.Message message, org.springframework.amqp.rabbit.connection.CorrelationData correlationData)- Overrides:
doSendAndReceiveWithFixedin classorg.springframework.amqp.rabbit.core.RabbitTemplate
-
-