Skip to content

Commit

Permalink
Add version check for headers
Browse files Browse the repository at this point in the history
  • Loading branch information
eapache committed Jun 15, 2018
1 parent 6967cdb commit 6d9cc20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions async_producer.go
Expand Up @@ -271,6 +271,9 @@ func (p *asyncProducer) dispatcher() {
version := 1
if p.conf.Version.IsAtLeast(V0_11_0_0) {
version = 2
} else if msg.Headers != nil {
p.returnError(msg, ConfigurationError("Producing headers requires Kafka at least v0.11"))
continue
}
if msg.byteSize(version) > p.conf.Producer.MaxMessageBytes {
p.returnError(msg, ErrMessageSizeTooLarge)
Expand Down

0 comments on commit 6d9cc20

Please sign in to comment.