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

Adding header on message #214

Merged
merged 1 commit into from
Jan 6, 2020
Merged

Conversation

toninho09
Copy link
Contributor

I changed the message to contain the headers

only work if set the client.Version to 0.11+ on samara client

Example processor with config.Version 2.2.0

p, err := goka.NewProcessor(
	brokers,
	g,
	goka.WithConsumerBuilder(func(brokers []string, group, clientID string) (consumer kafka.Consumer, err error) {
		config := kafka.NewConfig()
		config.ClientID = clientID
		config.Version = sarama.V2_2_0_0
		return kafka.NewSaramaConsumer(brokers, group, config)
	}),
)

Your can get the headers from context with ctx.Headers()

@db7
Copy link
Collaborator

db7 commented Dec 31, 2019

That's nice! LGTM @frairon

@frairon frairon merged commit 1cf2c41 into lovoo:master Jan 6, 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.

3 participants