Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receiving Kafka event on web browser real time

We are using Kafka cluster for sending/receiving messages at real time. We are able to publish messages to Kafka topics successfully. Now we want to receive these messages real time on a Single Page Application (SPA) running on a web browsers using JavaScript. Is it possible to push messages to SPA running on latest version any famous browser directly from Kafka? I found examples of receiving messages realtime using NodeJS but none with the JavaScript running on web browser.

like image 222
Deepak Bhatia Avatar asked Oct 26 '16 04:10

Deepak Bhatia


People also ask

Is Kafka real-time?

Apache Kafka is used for both real-time and batch data processing, and is the chosen event log technology for Amadeus microservice-based streaming applications. Kafka is also used for operational use cases such as application logs collection.

Does Kafka support Websockets?

kafka-websocket is a simple websocket server interface to the kafka distributed message broker. It supports clients subscribing to topics, including multiple topics at once, and sending messages to topics. Messages may be either text or binary, the format for each is described below.

How Kafka is used in real-time?

Kafka monitors all data communication in near real-time to implement access control, detect anomalies, and provide secure communication. This architecture enables the integration with non-connected legacy systems to collect sensor data but also ensures that no external system gets access to the unsecured machines.


1 Answers

There are Javascript clients for Kafka but given the description of your use case I would recommend you either use a REST or WebSocket proxy between your browser side javascript and Kafka. That will ensure the message can traverse any intermediate firewalls.

like image 112
Hans Jespersen Avatar answered Sep 25 '22 21:09

Hans Jespersen