-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consumer should throw an error if message exceeds fetchMaxBytes fixes #…
- Loading branch information
Showing
3 changed files
with
295 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var util = require('util'); | ||
|
||
var MessageSizeTooLarge = function (vars) { | ||
Error.captureStackTrace(this, this); | ||
if (typeof vars === 'object') { | ||
this.message = `Found a message larger than the maximum fetch size of this consumer on topic ${vars.topic} partition ${vars.partition} at fetch offset ${vars.offset}. Increase the fetch size, or decrease the maximum message size the broker will allow.`; | ||
} else { | ||
this.message = vars; | ||
} | ||
}; | ||
|
||
util.inherits(MessageSizeTooLarge, Error); | ||
MessageSizeTooLarge.prototype.name = 'MessageSizeTooLarge'; | ||
|
||
module.exports = MessageSizeTooLarge; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.