BlogsConfluentNode.js Kafka Client

Node.js Kafka Client

Node.js Kafka Client

2
posts
2019–2021

This post details building an asyncio-enabled Kafka producer and integrating it with FastAPI web applications. It covers creating a wrapper class for the Confluent Python client to support asyncio, handling delivery notifications, and implementing out-of-band error handling. The integration with FastAPI demonstrates how to use the producer in startup events and endpoint handlers, with examples of awaitable produce methods and load testing with Siege.

2021

Intro to KafkaJS - a Modern Kafka Client for Node.js

2/8/2021

Introduces KafkaJS, a pure JavaScript Kafka client for Node.js, detailing its architecture, API, and usage for producing and consuming messages. It provides a practical example of building an NPM package release notification system to Slack using KafkaJS, including configuration for authentication, message serialization (JSON), and error handling. The post also touches upon the potential for using KafkaJS in edge deployments and serverless functions.

2019

Integrating Apache Kafka with Python Asyncio Web Applications

12/5/2019

Introduces a wrapper class for the Confluent Python client to enable asyncio support, detailing the implementation of an `AIOProducer` with methods for producing messages and handling delivery callbacks. It also presents an integration example with FastAPI, showcasing how to manage the producer lifecycle and handle Kafka exceptions within web application endpoints. The post discusses strategies for out-of-band error handling and fire-and-forget scenarios, and includes load testing results using Siege.