public class BatchingRabbitTemplate extends RabbitTemplate
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.connection.CorrelationData))
are eligible for batching.
Experimental - APIs may change.
RabbitTemplate.ConfirmCallback, RabbitTemplate.ReturnCallback, RabbitTemplate.ReturnsCallback, RabbitTemplate.TemplateConsumerRabbitOperations.OperationsCallback<T>logger| Constructor and Description |
|---|
BatchingRabbitTemplate(BatchingStrategy batchingStrategy,
TaskScheduler scheduler)
Create an instance with the supplied parameters.
|
BatchingRabbitTemplate(ConnectionFactory connectionFactory,
BatchingStrategy batchingStrategy,
TaskScheduler scheduler)
Create an instance with the supplied parameters.
|
| 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.
|
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, doSendAndReceiveWithFixed, doSendAndReceiveWithTemporary, execute, expectedQueueNames, getAfterReceivePostProcessors, getEncoding, getExchange, getMessageConverter, getMessagePropertiesConverter, getRoutingKey, getUnconfirmed, getUnconfirmedCount, getUUID, handleConfirm, handleReturn, handleReturn, initDefaultStrategies, invoke, isChannelLocallyTransacted, isConfirmListener, isMandatoryFor, isReturnListener, 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, sendToRabbit, 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, setUseDirectReplyToContainer, setUsePublisherConnection, setUserCorrelationId, setUserIdExpression, setUserIdExpressionString, setUseTemporaryReplyQueues, start, stop, useDirectReplyTo, waitForConfirms, waitForConfirmsOrDieafterPropertiesSet, convertRabbitAccessException, createConnection, getChannel, getConnection, getConnectionFactory, getTransactionalResourceHolder, isChannelTransacted, setChannelTransactedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertSendAndReceiveAsType, getConnectionFactory, invokecontainerAckMode, onMessageBatchpublic BatchingRabbitTemplate(BatchingStrategy batchingStrategy, TaskScheduler scheduler)
batchingStrategy - the batching strategy.scheduler - the scheduler.public BatchingRabbitTemplate(ConnectionFactory connectionFactory, BatchingStrategy batchingStrategy, TaskScheduler scheduler)
connectionFactory - the connection factory.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 RabbitOperationsisRunning in interface LifecycleisRunning in class RabbitTemplate