UNPKG

kafkajs

Version:

A modern Apache Kafka client for node.js

28 lines (23 loc) 694 B
const { parse, decode: decodeV0 } = require('../v0/response') /** * Starting in version 1, on quota violation, brokers send out responses before throttling. * @see https://cwiki.apache.org/confluence/display/KAFKA/KIP-219+-+Improve+quota+communication * * InitProducerId Response (Version: 0) => throttle_time_ms error_code producer_id producer_epoch * throttle_time_ms => INT32 * error_code => INT16 * producer_id => INT64 * producer_epoch => INT16 */ const decode = async rawData => { const decoded = await decodeV0(rawData) return { ...decoded, throttleTime: 0, clientSideThrottleTime: decoded.throttleTime, } } module.exports = { decode, parse, }