public class RingBufferBatchingMessageHandler
extends java.lang.Object
implements org.springframework.messaging.MessageHandler, org.springframework.beans.factory.InitializingBean
MessageHandler implementation that buffers message payloads until
an internal RingBuffer is filled. When the buffer is full, a new aggregate
Message is created and sent into the delegate
MessageHandler.| Constructor and Description |
|---|
RingBufferBatchingMessageHandler(org.springframework.messaging.MessageHandler delegate,
int batchSize)
Create a batching handler using the given delegate and
batchSize. |
RingBufferBatchingMessageHandler(org.springframework.messaging.MessageHandler delegate,
int batchSize,
com.lmax.disruptor.dsl.ProducerType producerType,
com.lmax.disruptor.WaitStrategy waitStrategy)
Create a batching handler using the given delegate,
batchSize, .ProducerType, and WaitStrategy. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
handleMessage(org.springframework.messaging.Message<?> message) |
public RingBufferBatchingMessageHandler(org.springframework.messaging.MessageHandler delegate,
int batchSize)
batchSize.delegate - the delegate MessageHandler to invokebatchSize - the size of the batchpublic RingBufferBatchingMessageHandler(org.springframework.messaging.MessageHandler delegate,
int batchSize,
com.lmax.disruptor.dsl.ProducerType producerType,
com.lmax.disruptor.WaitStrategy waitStrategy)
batchSize, .ProducerType, and WaitStrategy.delegate - the delegate MessageHandler to invokebatchSize - the size of the batchproducerType - the ProducerTypewaitStrategy - the WaitStrategypublic void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic void handleMessage(org.springframework.messaging.Message<?> message)
throws org.springframework.messaging.MessagingException
handleMessage in interface org.springframework.messaging.MessageHandlerorg.springframework.messaging.MessagingException