Closed
Description
Versions
Please specify real version numbers or git SHAs, not just "Latest" since that changes fairly regularly.
Sarama | Kafka | Go |
---|---|---|
v1.26.1 | 2.4 | 1.13.4 |
Configuration
What configuration values are you using for Sarama and Kafka?
config.Producer.Return.Successes = false
config.Producer.Return.Errors = true
config.Producer.Retry.Max = 5
Problem Description
I am sending binary messages to kafka, that have this format:
[60 0 34 147 249 175 183 0 0 3 174 0 0 7 209 94 77 83 104 0 0 1 248 0 0 0 0 0 0 0 0 1 253 62]
( They start with < and end with > )
When I use the byte encoder, messages are 'mixed up' i.e. if I consume the stream of data back from Kafka things work fine, but the individual messages are broken in seemingly random places.
If I use the StringEncoder, I get the expected behaviour where each kafka message is complete. Is this an error ?
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
cheesedosa commentedon Mar 13, 2020
Sounds like an ownership issue. Are you reusing the
[]byte
after you call send? TheByteEncoder
does not make a copy.strings
in golang are always copies.ghost commentedon Mar 17, 2021
Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur.
Please check if the master branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.
dnwe commentedon Aug 24, 2023
Closing as believed to have been fixed. Issue due to []byte re-use