Support multiple Kafka broker addresses in endpoint URL#806
Open
badaverse wants to merge 1 commit intotidwall:masterfrom
Open
Support multiple Kafka broker addresses in endpoint URL#806badaverse wants to merge 1 commit intotidwall:masterfrom
badaverse wants to merge 1 commit intotidwall:masterfrom
Conversation
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.
Please ensure you adhere to every item in this list
Describe your changes
Summary
kafka://broker1:9092,broker2:9092/topic)Host/Portfields withBrokers []stringin the Kafka endpoint structChanges
internal/endpoint/endpoint.go: ReplaceHost string+Port intwithBrokers []stringin the Kafka struct. Update the URL parser to split the host portion on commas and collect eachhost:portpair into the slice.internal/endpoint/kafka.go: Passconn.ep.Kafka.Brokersdirectly tosarama.NewSyncProducerinstead of constructing a single URI string.internal/server/hooks.go: IntroducesplitEndpointURLs()to replace naive comma splitting. Parts without a scheme prefix (://orEndpoint=) are joined back to the preceding URL, sokafka://b1:9092,b2:9092/topic,http://backup/hookcorrectly splits into two endpoints.Backward compatibility
kafka://host:9092/topic) continue to work as before.Issue number and link
#805