最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Receiving Kafka event on web browser real time - Stack Overflow

programmeradmin0浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 12

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.

发布评论

评论列表(0)

  1. 暂无评论