-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PIP-?] Optimization of massive delayed message scenarios #15500
Comments
there is already another PIP with this PIP-number: please see https://github.com/apache/pulsar/wiki/Pulsar-Improvement-Proposal-%28PIP%29 |
The issue had no activity for 30 days, mark with Stale label. |
it looks like addressed by #16763 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
Business scene
Delayed messages are a common scenario in the Message business system. For example, group-opening reminders in group buying activities, automatic deductions when continuous monthly subscriptions expire, and coupon expiration reminders can all be implemented with delayed messages.
Current Mode
Currently Pulsar implements arbitrarily delayed messages based on in-memory time rounds. The Producer side can send a mixture of ordinary messages and delayed messages to topics and persist them to Bookkeeper. Now delayed messages can only support shard mode subscriptions,each subscription group will identify delayed messages and add them to the time wheel. The default time granularity of the time wheel is 1 second. The time wheel stores the delayed timestamp, ledgerId and EntryId related index information. When the time arrives, the message will be read and sent to the Consumer according to the ledgerId and EntryId.
Current Problems
Goat
Optimization ideas
Reduce the delay message magnitude for the current build time round. We can use the delay class to divide the overall delayed messages into time ranges, so that we only need to care about the most recent delayed messages. For example, a message with a relatively large time span is stored in a common topic (delay level topic), and then a certain mechanism is used to ensure that the message that is about to expire is placed in the time wheel over time, so that to a certain extent, the message can be greatly improved. Reduce the magnitude of delayed messages on the time wheel, thereby mitigating the impact of the problems described above.
Implementation details
Questions
Proposed Changes
Client API
#delayLevelTopicEnabled
#delayLevelTopicName
#partitionStrategy
inProducerConfigurationData.java
DelayLevelTopicPartitionStrategy.java
#enableDelayLevelTopic(boolean delayLevelTopicEnabled)
#delayLevelTopic(String delayLevelTopicName)
#delayLevelTopicPartitionStrategy(DelayLevelTopicPartitionStrategy strategy)
inProducerBuilder.java
Broker
TODO
Functions
TODO : Timing synchronization level delay message in topic to business topic
The text was updated successfully, but these errors were encountered: