This may imply Kafkajs producer doesn't have internal buffer. What would be the best practices to handle heavy traffic(e.g 1k number of messages or 100Mb size per second ) sent out by producer? For example, assume the upper limit (e.g. max num of msg or size of total msg) of a producer can handle is N. When traffic is 2N, how does Kafkajs producer handle it? Does anyone have experience in production to share?
Asked
Active
Viewed 313 times
0

OneCricketeer
- 179,855
- 19
- 132
- 245

androidkc
- 689
- 2
- 7
- 16
-
Commented on gjthub issue – OneCricketeer Mar 07 '22 at 22:09
-
just read the code, the encoder does have internal buffer, https://github.com/tulios/kafkajs/blob/1876abcb5effd6183c1fbaa50dee9cef269b67a5/src/protocol/encoder.js#L67 but it is configurable at this point. What is the best way to handle when buffer is full – androidkc Mar 07 '22 at 22:26
-
1The `ensureAvailable` function there seems to handle that case – OneCricketeer Mar 08 '22 at 00:58