user2407164
user2407164

Reputation: 71

Kafka Python producer integration with django web app

I have a question on how can we integrate kafka producer with a front end web app. get the data for every minute or second . Can the web app pass the JSON object to a running producer each time the it is created ? or do we need to initiate the kafka client each time we get a JSON object ?

Upvotes: 2

Views: 2400

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191725

You would want to probably open a new Producer for every session, probably not open and close for each and every request. And this would be done on the backend, not the frontend.

But a web server consisting of a Kafka client is no different underneath the HTTP layer vs a regular console app; you accept an incoming request, deserialize it, then optionally parse, then serialize again for Kafka output, then optionally render something back to the user.

If you're really asking, "is Kafka with HTTP requests possible", regardless of the language and platforms, then sure, the Confluent REST Proxy operates similarly, only written in Java

As far as webapps tracking goes, I would suggest looking into Divolte Collector

Upvotes: 3

Related Questions