public class TestRabbitTemplate
extends org.springframework.amqp.rabbit.core.RabbitTemplate
implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
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.org.springframework.amqp.rabbit.core.RabbitTemplate.ConfirmCallback, org.springframework.amqp.rabbit.core.RabbitTemplate.ReturnCallback, org.springframework.amqp.rabbit.core.RabbitTemplate.TemplateConsumer| Constructor and Description |
|---|
TestRabbitTemplate(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory) |
| Modifier and Type | Method and Description |
|---|---|
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) |
void |
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) |
protected void |
sendToRabbit(com.rabbitmq.client.Channel channel,
java.lang.String exchange,
java.lang.String routingKey,
boolean mandatory,
org.springframework.amqp.core.Message message) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
protected boolean |
useDirectReplyTo() |
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, initDefaultStrategies, invoke, isChannelLocallyTransacted, isConfirmListener, isMandatoryFor, isReturnListener, isRunning, isUsePublisherConnection, 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, 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, setRoutingKey, setSendConnectionFactorySelectorExpression, setTaskExecutor, setUseDirectReplyToContainer, setUsePublisherConnection, setUserCorrelationId, setUserIdExpression, setUserIdExpressionString, setUseTemporaryReplyQueues, start, stop, waitForConfirms, waitForConfirmsOrDieafterPropertiesSet, convertRabbitAccessException, createConnection, getChannel, getConnection, getConnectionFactory, getTransactionalResourceHolder, isChannelTransacted, setChannelTransactedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic TestRabbitTemplate(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>protected boolean useDirectReplyTo()
useDirectReplyTo in class org.springframework.amqp.rabbit.core.RabbitTemplateprotected void sendToRabbit(com.rabbitmq.client.Channel channel,
java.lang.String exchange,
java.lang.String routingKey,
boolean mandatory,
org.springframework.amqp.core.Message message)
sendToRabbit in class org.springframework.amqp.rabbit.core.RabbitTemplateprotected 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)
doSendAndReceiveWithFixed in class org.springframework.amqp.rabbit.core.RabbitTemplate