public class SimpleBatchingStrategy extends java.lang.Object implements BatchingStrategy
| Constructor and Description |
|---|
SimpleBatchingStrategy(int batchSize,
int bufferLimit,
long timeout) |
| Modifier and Type | Method and Description |
|---|---|
MessageBatch |
addToBatch(java.lang.String exchange,
java.lang.String routingKey,
org.springframework.amqp.core.Message message)
Add a message to the batch and optionally release the batch.
|
java.util.Date |
nextRelease() |
java.util.Collection<MessageBatch> |
releaseBatches()
Release batch(es), perhaps due to a timeout.
|
public SimpleBatchingStrategy(int batchSize,
int bufferLimit,
long timeout)
batchSize - the batch size.bufferLimit - the max buffer size; could trigger a short batch. Does not apply
to a single message.timeout - the batch timeout.public MessageBatch addToBatch(java.lang.String exchange, java.lang.String routingKey, org.springframework.amqp.core.Message message)
BatchingStrategyaddToBatch in interface BatchingStrategyexchange - The exchange.routingKey - The routing key.message - The message.MessageBatch), or null if not ready to release.public java.util.Date nextRelease()
nextRelease in interface BatchingStrategypublic java.util.Collection<MessageBatch> releaseBatches()
BatchingStrategyreleaseBatches in interface BatchingStrategy