Skip to content

Commit

Permalink
Rename configuration property that uses msgInReplay concept
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari committed Aug 28, 2024
1 parent cf01e54 commit 62a9fbf
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions conf/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -359,20 +359,20 @@ maxUnackedMessagesPerSubscriptionOnBrokerBlocked=0.16
# or a blocked key hash (because of ordering constraints), the broker will continue reading more
# messages from the backlog and attempt to dispatch them to consumers until the number of replay
# messages reaches the calculated threshold.
# Formula: threshold = max(keySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer *
# connected consumer count, keySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription).
# Formula: threshold = max(keySharedLookAheadMsgInReplayThresholdPerConsumer *
# connected consumer count, keySharedLookAheadMsgInReplayThresholdPerSubscription).
# Setting this value to 0 will disable the limit calculated per consumer.
keySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer=1000
keySharedLookAheadMsgInReplayThresholdPerConsumer=1000

# For Key_Shared subscriptions, if messages cannot be dispatched to consumers due to a slow consumer
# or a blocked key hash (because of ordering constraints), the broker will continue reading more
# messages from the backlog and attempt to dispatch them to consumers until the number of replay
# messages reaches the calculated threshold.
# Formula: threshold = max(keySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer *
# connected consumer count, keySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription).
# Formula: threshold = max(keySharedLookAheadMsgInReplayThresholdPerConsumer *
# connected consumer count, keySharedLookAheadMsgInReplayThresholdPerSubscription).
# This value should be set to a value less than 2 * managedLedgerMaxUnackedRangesToPersist.
# Setting this value to 0 will disable the limit calculated per subscription.
keySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription=10000
keySharedLookAheadMsgInReplayThresholdPerSubscription=10000

# For Key_Shared subscriptions, if messages cannot be dispatched to consumers due to a slow consumer
# or a blocked key hash (because of ordering constraints), the broker will continue reading more
Expand Down
12 changes: 6 additions & 6 deletions conf/standalone.conf
Original file line number Diff line number Diff line change
Expand Up @@ -236,20 +236,20 @@ maxUnackedMessagesPerSubscriptionOnBrokerBlocked=0.16
# or a blocked key hash (because of ordering constraints), the broker will continue reading more
# messages from the backlog and attempt to dispatch them to consumers until the number of replay
# messages reaches the calculated threshold.
# Formula: threshold = max(keySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer *
# connected consumer count, keySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription).
# Formula: threshold = max(keySharedLookAheadMsgInReplayThresholdPerConsumer *
# connected consumer count, keySharedLookAheadMsgInReplayThresholdPerSubscription).
# Setting this value to 0 will disable the limit calculated per consumer.
keySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer=1000
keySharedLookAheadMsgInReplayThresholdPerConsumer=1000

# For Key_Shared subscriptions, if messages cannot be dispatched to consumers due to a slow consumer
# or a blocked key hash (because of ordering constraints), the broker will continue reading more
# messages from the backlog and attempt to dispatch them to consumers until the number of replay
# messages reaches the calculated threshold.
# Formula: threshold = max(keySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer *
# connected consumer count, keySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription).
# Formula: threshold = max(keySharedLookAheadMsgInReplayThresholdPerConsumer *
# connected consumer count, keySharedLookAheadMsgInReplayThresholdPerSubscription).
# This value should be set to a value less than 2 * managedLedgerMaxUnackedRangesToPersist.
# Setting this value to 0 will disable the limit calculated per subscription.
keySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription=10000
keySharedLookAheadMsgInReplayThresholdPerSubscription=10000

# For Key_Shared subscriptions, if messages cannot be dispatched to consumers due to a slow consumer
# or a blocked key hash (because of ordering constraints), the broker will continue reading more
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -954,28 +954,28 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
+ " or a blocked key hash (because of ordering constraints), the broker will continue reading more"
+ " messages from the backlog and attempt to dispatch them to consumers until the number of replay"
+ " messages reaches the calculated threshold.\n"
+ "Formula: threshold = max(keySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer *"
+ " connected consumer count, keySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription)"
+ "Formula: threshold = max(keySharedLookAheadMsgInReplayThresholdPerConsumer *"
+ " connected consumer count, keySharedLookAheadMsgInReplayThresholdPerSubscription)"
+ ".\n"
+ "Setting this value to 0 will disable the limit calculated per consumer.",
dynamic = true
)
private int keySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer = 1000;
private int keySharedLookAheadMsgInReplayThresholdPerConsumer = 1000;

@FieldContext(
category = CATEGORY_POLICIES,
doc = "For Key_Shared subscriptions, if messages cannot be dispatched to consumers due to a slow consumer"
+ " or a blocked key hash (because of ordering constraints), the broker will continue reading more"
+ " messages from the backlog and attempt to dispatch them to consumers until the number of replay"
+ " messages reaches the calculated threshold.\n"
+ "Formula: threshold = max(keySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer *"
+ " connected consumer count, keySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription)"
+ "Formula: threshold = max(keySharedLookAheadMsgInReplayThresholdPerConsumer *"
+ " connected consumer count, keySharedLookAheadMsgInReplayThresholdPerSubscription)"
+ ".\n"
+ "This value should be set to a value less than 2 * managedLedgerMaxUnackedRangesToPersist.\n"
+ "Setting this value to 0 will disable the limit calculated per subscription.\n",
dynamic = true
)
private int keySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription = 10000;
private int keySharedLookAheadMsgInReplayThresholdPerSubscription = 10000;


@FieldContext(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ private boolean isLookAheadAllowed() {
if (serviceConfig.isKeySharedLookAheadEnabledWhenRecentlyJoinedConsumersExist()
|| (recentlyJoinedConsumers == null || recentlyJoinedConsumers.isEmpty())) {
long keySharedNumberOfReplayMessagesThresholdForLookAhead = Math.max(
serviceConfig.getKeySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer()
serviceConfig.getKeySharedLookAheadMsgInReplayThresholdPerConsumer()
* consumerList.size(),
serviceConfig.getKeySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription());
serviceConfig.getKeySharedLookAheadMsgInReplayThresholdPerSubscription());
if (keySharedNumberOfReplayMessagesThresholdForLookAhead == 0
|| redeliveryMessages.size() < keySharedNumberOfReplayMessagesThresholdForLookAhead) {
return true;
Expand Down Expand Up @@ -607,8 +607,8 @@ private synchronized Position updateIfNeededAndGetLastSentPosition() {
* limits kick in), instead of keep replaying the same old messages, since the consumer that these
* messages are routing to might be busy at the moment.
*
* Please see {@link ServiceConfiguration#keySharedLookAheadNumberOfReplayMessagesThresholdPerConsumer},
* {@link ServiceConfiguration#keySharedLookAheadNumberOfReplayMessagesThresholdPerSubscription} and
* Please see {@link ServiceConfiguration#keySharedLookAheadMsgInReplayThresholdPerConsumer},
* {@link ServiceConfiguration#keySharedLookAheadMsgInReplayThresholdPerSubscription} and
* {@link ServiceConfiguration#keySharedLookAheadEnabledWhenRecentlyJoinedConsumersExist} for configuring
* the limits.
*/
Expand Down

0 comments on commit 62a9fbf

Please sign in to comment.