kafka can replace channels ?

What is kafka used for ? I can replace channels[daphne] with Kafka ?

I mainly want a user notification system.

Kafka is a message broker.

Conceptually, it would be roughly equivalent to Redis in the Channels environment. This means that it is not designed to be a websocket endpoint, but there is a plugin to allow it to do that.

However, that still doesn’t provide the integration with your Django environment.

So yes, you could set up a kafka server that the browsers connect to, and then write a Django/Kafka interface in Django for Django to send messages to it. Then you would still need Daphne/uvicorn to run an async listener process to be able to receive messages back - unless you wanted to create a kafka plugin to send to a REST-style api.

1 Like