Skip to content
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

Support producer name for Message #299

Merged
merged 5 commits into from
Jun 26, 2020

Conversation

wolfstudy
Copy link
Member

Signed-off-by: xiaolong.ran rxl@apache.org

Fixes #295

Motivation

Support producer name for Message interface, allows the user to get the producerName of the message in the received message.

msg, err := consumer.Receive(context.Background())
if err != nil {
	log.Fatal(err)
}
	
log.Println(msg.ProducerName())

Modifications

  • add producerName filed to message struct

Signed-off-by: xiaolong.ran <rxl@apache.org>
@wolfstudy wolfstudy self-assigned this Jun 26, 2020
@wolfstudy wolfstudy added this to the 0.2.0 milestone Jun 26, 2020
@wolfstudy
Copy link
Member Author

@merlimat Hello, currently, the Jenkinns CI still running, Do we need to do anything else for this?

@wolfstudy
Copy link
Member Author

@JoseFMP PTAL thanks

Signed-off-by: xiaolong.ran <rxl@apache.org>
Signed-off-by: xiaolong.ran <rxl@apache.org>
@@ -64,6 +64,9 @@ type Message interface {
// Topic get the topic from which this message originated from
Topic() string

// ProducerName will get producer name from broker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saying "from broker" can be misleading since we're not fetching it from the broker, rather the name comes attached to the message metadata.

In Java client doc we have:

Get the producer name who produced this message.
Suggested change
// ProducerName will get producer name from broker
// ProducerName returns the name of the producer that has published the message

Signed-off-by: xiaolong.ran <rxl@apache.org>
Signed-off-by: xiaolong.ran <rxl@apache.org>
@merlimat merlimat merged commit f7ca912 into apache:master Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide producer name
2 participants