Skip to content

Conversation

@hangc0276
Copy link
Contributor

Motivation

In current isExceedMaximumMessageSize implementation, it get topic policy and compare maxMessageSize value.
However, for each message to publish, it should call isExceedMaximumMessageSize once, which cost too much resources.

Modifiction

  1. add maxMessageSizeCheckIntervalInSeconds parameter to control maxMessageSize refresh frequency
  2. reduce getTopicPolicies call frequency to reduce resources cost.
  3. add test to cover this case.

Copy link
Member

@Anonymitaet Anonymitaet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hangc0276 thanks for your contribution! I've left a comment, PTAL.

Besides, need to add the descriptions to docs (https://pulsar.apache.org/docs/en/next/reference-configuration/)?

Co-authored-by: Anonymitaet <50226895+Anonymitaet@users.noreply.github.com>
@sijie sijie added this to the 2.9.0 milestone Jul 14, 2021
@sijie sijie merged commit 6384f94 into apache:master Jul 14, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
…he#11141)

### Motivation
In current `isExceedMaximumMessageSize` implementation, it get topic policy and compare maxMessageSize value.
However, for each message to publish, it should call isExceedMaximumMessageSize once, which cost too much resources.

### Modifiction
1. add `maxMessageSizeCheckIntervalInSeconds` parameter to control maxMessageSize refresh frequency
2. reduce getTopicPolicies call frequency to reduce resources cost.
3. add test to cover this case.
Shawyeok added a commit to Shawyeok/pulsar that referenced this pull request Nov 7, 2025
The configuration `maxMessageSizeCheckIntervalInSeconds` was introduced in apache#11141. After the topic local cache was added (apache#12830), this configuration became obsolete and is now unused.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants