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.
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.
Share Improve this question asked Oct 26, 2016 at 4:01 Deepak BhatiaDeepak Bhatia 1,1001 gold badge8 silver badges13 bronze badges 1- I don't think you can consume Kafka messages directly in java script , you should have server side technology to consume the messages as per my understanding. – Arunakiran Nulu Commented Oct 26, 2016 at 5:03
1 Answer
Reset to default 12There 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.