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

How do I specify partitions for production messages #2844

Open
gopherhiro opened this issue Mar 30, 2024 · 2 comments
Open

How do I specify partitions for production messages #2844

gopherhiro opened this issue Mar 30, 2024 · 2 comments

Comments

@gopherhiro
Copy link

No description provided.

@gopherhiro
Copy link
Author

	msg := &sarama.ProducerMessage{
		Topic:     "example-topic",
		Partition: 0,
		Value:     sarama.StringEncoder("Hello, Kafka! - 1, i: " + string(i)),
	}

I specified it explicitly, but it didn't work

@gopherhiro
Copy link
Author

2024/03/30 21:54:46 Message sent to partition 0 at offset 28640
2024/03/30 21:54:47 Message sent to partition 0 at offset 28642
2024/03/30 21:54:48 Message sent to partition 1 at offset 15024
2024/03/30 21:54:49 Message sent to partition 1 at offset 15025
2024/03/30 21:54:50 Message sent to partition 1 at offset 15027

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

No branches or pull requests

1 participant