-
Notifications
You must be signed in to change notification settings - Fork 12k
[RIP-43] Support Timing Messages with Arbitrary Time Delay #4642
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There are benchmarks in the current example module, but I think it would be better to add the most straightforward example to tell users how to use timing messages with arbitrary time delay. In addition, adding relevant documents is also a good choice
- It would be better to add an IT test.
- It is necessary to replace the origin delay level message with new timer message in the POP consume. It can also be completed in the subsequent pull requests.
- The current implementation needs to adapt to the slaveActingMaster mode. If no one is willing to do it, I am willing to do this in the subsequent pull requests later.
example/pom.xml
Outdated
| <dependency> | ||
| <groupId>commons-cli</groupId> | ||
| <artifactId>commons-cli</artifactId> | ||
| <version>1.4</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this line, we can use the parent pom file dependency.
store/pom.xml
Outdated
| <dependency> | ||
| <groupId>com.conversantmedia</groupId> | ||
| <artifactId>disruptor</artifactId> | ||
| <version>1.2.10</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if we can put the version to the parent pom file.
| public static final String ONS_HTTP_PROXY_GROUP = "CID_ONS-HTTP-PROXY"; | ||
| public static final String CID_ONSAPI_PERMISSION_GROUP = "CID_ONSAPI_PERMISSION"; | ||
| public static final String CID_ONSAPI_OWNER_GROUP = "CID_ONSAPI_OWNER"; | ||
| public static final String SYSTEM_TOPIC_PREFIX = "RMQ_SYS_"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an same constant in the TopicValidator class (org.apache.rocketmq.common.topic.TopicValidator#SYSTEM_TOPIC_PREFIX). I don't think it's necessary to re create one here
|
Conflicting files @GenerousMan |
| long deliverMs; | ||
| try { | ||
| if (msg.getProperty(MessageConst.PROPERTY_TIMER_DELAY_SEC) != null) { | ||
| deliverMs = System.currentTimeMillis() + Integer.parseInt(msg.getProperty(MessageConst.PROPERTY_TIMER_DELAY_SEC)) * 1000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when set setDelayTimeSec(24 * 3600 * 3), integer overflows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, it has been resolved.
# Conflicts: # broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java # store/src/main/java/org/apache/rocketmq/store/config/MessageStoreConfig.java
| TimerMessageStore getTimerMessageStore(); | ||
|
|
||
| void setTimerMessageStore(TimerMessageStore timerMessageStore); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better. to add some comments for the interface.
| public long checkPhyPos(long timeStartMs, long maxOffset) { | ||
| long minFirst = Long.MAX_VALUE; | ||
| int firstSlotIndex = getSlotIndex(timeStartMs); | ||
| for (int i = 0; i < slotsTotal * 2; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that slotsTotal * 2 appears multiple times. Why do we need to multiply it by 2? I don't understand, could you please help me? Thanks. @GenerousMan
Make sure set the target branch to
developWhat is the purpose of the change
Currently, RocketMQ's delay message feature only supports delayed delivery for specific time levels. Such delay message feature(only support specific levels of delay time) is no longer enough to support the flexible usage of rocketmq. Therefore, we need a delay message feature that supports arbitrary delay time.
I have written my proposal on the links below:
Google Doc: https://docs.google.com/document/d/1D6XWwY39p531c2aVi5HQll9iwzTUNT1haUFHqMoRkT0/edit?usp=sharing
Shimo:https://shimo.im/docs/gXqme9PKKpIeD7qo/
To optimize the commit history, this is a new PR.
The old PR is :#4558
Brief changelog
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.[ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyleto make sure basic checks pass. Runmvn clean install -DskipITsto make sure unit-test pass. Runmvn clean test-compile failsafe:integration-testto make sure integration-test pass.