public static class ConsumerFlowStrategy.MessageCountConsumerFlowStrategy extends Object implements ConsumerFlowStrategy
Make sure to call MessageHandler.Context.processed() on every message when using
this strategy, otherwise the broker may stop sending messages to the consumer.
ConsumerFlowStrategy.Context, ConsumerFlowStrategy.CreditOnChunkArrivalConsumerFlowStrategy, ConsumerFlowStrategy.MessageCountConsumerFlowStrategy, ConsumerFlowStrategy.MessageProcessedCallback| Modifier and Type | Method and Description |
|---|---|
int |
initialCredits()
The initial number of credits for a subscription.
|
ConsumerFlowStrategy.MessageProcessedCallback |
start(ConsumerFlowStrategy.Context context)
Return the behavior for
MessageHandler.Context.processed() calls. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreditOnChunkArrival, creditOnChunkArrival, creditOnProcessedMessageCount, creditWhenHalfMessagesProcessed, creditWhenHalfMessagesProcessedpublic int initialCredits()
ConsumerFlowStrategyIt must be greater than 0. Values are usually between 1 and 10.
initialCredits in interface ConsumerFlowStrategypublic ConsumerFlowStrategy.MessageProcessedCallback start(ConsumerFlowStrategy.Context context)
ConsumerFlowStrategyMessageHandler.Context.processed() calls.
This method is called for each chunk of messages. Implementations return a callback that
will be called when applications consider a message dealt with and call MessageHandler.Context.processed(). The callback can count messages and provide credits
accordingly.
start in interface ConsumerFlowStrategycontext - chunk contextCopyright © 2024 Broadcom Inc. and/or its subsidiaries. All rights reserved.