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:
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>
A
RabbitTemplate that invokes @RabbitListener s 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.TemplateConsumerNested classes/interfaces inherited from interface org.springframework.amqp.rabbit.core.RabbitOperations
org.springframework.amqp.rabbit.core.RabbitOperations.OperationsCallback<T extends Object> -
Field Summary
Fields inherited from class org.springframework.amqp.rabbit.connection.RabbitAccessor
logger -
Constructor Summary
ConstructorsConstructorDescriptionTestRabbitTemplate(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.amqp.core.MessagedoSendAndReceiveWithFixed(String exchange, 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, String exchange, String routingKey, boolean mandatory, org.springframework.amqp.core.Message message) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) protected booleanMethods 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, doReceiveNoWait, doSend, doSendAndReceive, doSendAndReceiveWithTemporary, doStart, doStop, execute, expectedQueueNames, getAfterReceivePostProcessors, getDefaultReceiveQueue, 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, waitForConfirmsOrDieMethods inherited from class org.springframework.amqp.rabbit.connection.RabbitAccessor
afterPropertiesSet, convertRabbitAccessException, createConnection, getChannel, getConnection, getConnectionFactory, getTransactionalResourceHolder, isChannelTransacted, setChannelTransactedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener
onMessageBatchMethods inherited from interface org.springframework.amqp.core.MessageListener
containerAckMode, isAsyncReplies, onMessageBatchMethods inherited from interface org.springframework.amqp.rabbit.core.RabbitOperations
convertSendAndReceiveAsType, getConnectionFactory, invoke
-
Constructor Details
-
TestRabbitTemplate
public TestRabbitTemplate(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)
-
-
Method Details
-
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, String exchange, 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(String exchange, String routingKey, org.springframework.amqp.core.Message message, org.springframework.amqp.rabbit.connection.CorrelationData correlationData) - Overrides:
doSendAndReceiveWithFixedin classorg.springframework.amqp.rabbit.core.RabbitTemplate
-