I'm using kafkajs nodejs library, which doesn't fully implement a batch publish, and from my side I see only one way - is implement it by myself, but I don't fully understand how to do it, so I have some questions
- How should I calculate message size to implement
batch.size
property? - If application is gracefully shutdown, then I can just force publish messages from the producer buffer in the shutdown hooks, is it right?
- If application was killed by
sigkill
signal, how I should avoid messages lost?