[ROCKETMQ-141]Make producer client connect to new-joined brokers eagerly#78
Closed
lizhanhui wants to merge 1 commit intoapache:developfrom
Closed
[ROCKETMQ-141]Make producer client connect to new-joined brokers eagerly#78lizhanhui wants to merge 1 commit intoapache:developfrom
lizhanhui wants to merge 1 commit intoapache:developfrom
Conversation
1 similar comment
Contributor
Author
|
Guys, any idea on this PR? |
Member
|
@lizhanhui I will close the pr, if you happened to the same question, please let me know. |
lizhanhui
pushed a commit
to lizhanhui/rocketmq
that referenced
this pull request
Jun 25, 2019
pingww
pushed a commit
that referenced
this pull request
Aug 26, 2022
* Fix the bug of Get Start in Readme * Tips for optimizing broker configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When new brokers joins the cluster, MQ producer clients polls name server and add the new-joined brokers to topicPublishInfo in case the new-joined broker bears the topic. Later on, the producers may send messages to the new-joined brokers.
This achieves part of scalable goals and works fine for most cases. However, we ran an issue in this process. The problem is when new broker joins the cluster, the producer clients blocks for quite a while even if when asynchronous send method is employed, which is very miserable for latency sensitive scenarios.
After analyzing the root cause, it turns out that producer clients need to establish a connection to the new-joined brokers the first time it sends a message, as is blocking.
This issue is to establish a connection to new-joined brokers immediately after polling name server and make them available to send methods thereafter. Thus, when send is called against new-joined brokers, there is a writable channel readily available.