public class BatchingRabbitTemplate extends RabbitTemplate implements org.springframework.context.Lifecycle
RabbitTemplate that permits batching individual messages into a larger
message. All send() methods (except
send(String, String, org.springframework.amqp.core.Message,
org.springframework.amqp.rabbit.support.CorrelationData))
are eligible for batching.
Experimental - APIs may change.
RabbitTemplate.ConfirmCallback, RabbitTemplate.ReturnCallback, RabbitTemplate.TemplateConsumerRabbitOperations.OperationsCallback<T>logger| Constructor and Description |
|---|
BatchingRabbitTemplate(BatchingStrategy batchingStrategy,
org.springframework.scheduling.TaskScheduler scheduler) |
| Modifier and Type | Method and Description |
|---|---|
void |
doStart()
Perform additional start actions.
|
void |
doStop()
Perform additional stop actions.
|
void |
flush()
Flush any partial in-progress batches.
|
boolean |
isRunning() |
void |
send(String exchange,
String routingKey,
Message message,
CorrelationData correlationData)
Send a message to a specific exchange with a specific routing key.
|
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, convertSendAndReceiveAsType, convertSendAndReceiveRaw, correlationConvertAndSend, determineConfirmsReturnsCapability, doReceiveNoWait, doSend, doSendAndReceive, doSendAndReceiveWithFixed, doSendAndReceiveWithTemporary, execute, expectedQueueNames, getEncoding, getExchange, getMessageConverter, getMessagePropertiesConverter, getRoutingKey, getUnconfirmed, getUnconfirmedCount, getUUID, handleConfirm, handleReturn, initDefaultStrategies, invoke, isChannelLocallyTransacted, isConfirmListener, isMandatoryFor, isReturnListener, onMessage, receive, receive, receive, receive, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndConvert, receiveAndReply, receiveAndReply, receiveAndReply, receiveAndReply, receiveAndReply, receiveAndReply, revoke, send, send, send, sendAndReceive, sendAndReceive, sendAndReceive, sendAndReceive, sendAndReceive, sendAndReceive, sendToRabbit, setAfterReceivePostProcessors, setBeanFactory, setBeanName, setBeforePublishPostProcessors, setConfirmCallback, setCorrelationDataPostProcessor, setCorrelationKey, setEncoding, setExchange, setMandatory, setMandatoryExpression, setMandatoryExpressionString, setMessageConverter, setMessagePropertiesConverter, setQueue, setReceiveConnectionFactorySelectorExpression, setReceiveTimeout, setRecoveryCallback, setReplyAddress, setReplyTimeout, setRetryTemplate, setReturnCallback, setRoutingKey, setSendConnectionFactorySelectorExpression, setTaskExecutor, setUseDirectReplyToContainer, setUserIdExpression, setUserIdExpressionString, setUseTemporaryReplyQueues, start, stop, useDirectReplyTo, waitForConfirms, waitForConfirmsOrDieafterPropertiesSet, convertRabbitAccessException, createConnection, getChannel, getConnection, getConnectionFactory, getTransactionalResourceHolder, isChannelTransacted, setChannelTransacted, setConnectionFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConnectionFactorypublic BatchingRabbitTemplate(BatchingStrategy batchingStrategy, org.springframework.scheduling.TaskScheduler scheduler)
batchingStrategy - the batching strategy.scheduler - the scheduler.public void send(String exchange, String routingKey, Message message, CorrelationData correlationData) throws AmqpException
RabbitOperationssend in interface RabbitOperationssend in class RabbitTemplateexchange - the name of the exchangeroutingKey - the routing keymessage - a message to sendcorrelationData - data to correlate publisher confirms.AmqpException - if there is a problempublic void flush()
public void doStart()
RabbitTemplatedoStart in class RabbitTemplatepublic void doStop()
RabbitTemplatedoStop in class RabbitTemplatepublic boolean isRunning()
isRunning in interface org.springframework.context.LifecycleisRunning in class RabbitTemplate