use subjects for generating topic name instead of name from streamconfig#33
Open
grumblebrian wants to merge 1 commit into
Open
use subjects for generating topic name instead of name from streamconfig#33grumblebrian wants to merge 1 commit into
grumblebrian wants to merge 1 commit into
Conversation
|
This is indeed important. I often have to manually setup the streams due to this watermill behavior. |
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.
Motivation / Background
The JetStream Publish function uses streamConfig.Name for the topic when marshaling the message, when it should be using streamConfig.Subjects. This is not a problem when using defaultStreamConfigurator since that sets the passed in topic as the name while also setting the first Subjects item to the topic. However, when using a custom (existing) stream config it is likely that the name will be different from the topic. This is because topics typically contain periods to reflect a topic hierarchy and periods cannot be used in stream names. Thus, a custom jetstream.StreamConfig likely appears similar to the following:
Typically, stream names are capitalized but that is not required.
Details
This was a simple change to use streamConfig.Subjects[0] instead of streamConfig.Name for the topic when calling the Marshal function. This does not change the default behavior when the ConfigureStream PublisherConfig option is not used when creating a JetStream publisher since defaultStreamConfigurator sets both Name and Subjects with the passed-in topic.
Checklist
The resources of our team are limited. There are a couple of things that you can do to help us merge your PR faster:
make up.make test_shortfor a quick check.make test.