oleksiyk / kafka

Apache Kafka 0.9 client for Node
MIT License
297 stars 85 forks source link

Unclear error handling for over-sized message. #223

Closed Chengxuan closed 6 years ago

Chengxuan commented 6 years ago

When putting an over-sized message (i.e. 1 mb default) onto a topic, Producer.send method resolved with a success response but an offset with -1 instead of rejecting the promise.

If this is an intended behavior, have you documented it somewhere? Are there any other scenarios following the same response pattern? It took us a while to figure out this since we were expecting kafka producer to reject whenever a message cannot be put onto the queue.

oleksiyk commented 6 years ago

This is intended behaviour. Check for error field in each producer topic/partition response object. Producer can't reject the whole send call because it sends multiple topic/partition payloads at the same time and some of them may fail while others not.