GitHub user victor-wong opened a pull request:
https://github.com/apache/storm/pull/1443
Throw exception if messages fetched by storm-kafka is emtpy
In kafka
[ConsumerIterator](https://github.com/apache/kafka/blob/a81ad2582ee0e533d335fe0dc5c5cc885dbf645d/core/src/main/scala/kafka/consumer/ConsumerIterator.scala),
there is some codes like this:
`// if we just updated the current chunk and it is empty that means the
fetch size is too small!
if(currentDataChunk.messages.validBytes == 0)
throw new MessageSizeTooLargeException("Found a message larger than
the maximum fetch size of this consumer on topic " +
"%s partition %d at fetch
offset %d. Increase the fetch size, or decrease the maximum message size the
broker will allow."
.format(currentDataChunk.topicInfo.topic,
currentDataChunk.topicInfo.partitionId, currentDataChunk.fetchOffset))`
When "fetch.message.max.bytes" config is smaller than the actual message
size in topic, ConsumerIterator will throw an exception to notify user.
But in storm-kafka, there is no such logic. And as a result, if
KafkaConfig.fetchSizeBytes is smaller than actual message size, the topology
will fetch no data but still be running.
To prevent this situation, we need throw MessageSizeTooLargeException as
well.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/victor-wong/storm feature-fix-kafka-msg
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/1443.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1443
----
commit ff227f1f050cb9dd6a439d8053a905f37b4770ea
Author: wangjiasheng <[email protected]>
Date: 2016-05-24T08:32:16Z
Throw Kafka MessageSizeTooLargeException in case of fetched data is empty
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---