简体   繁体   English

将Apache kafka与Angular.js集成

[英]Integrating Apache kafka with Angular.js

I created a Topic 'sample' in apache kafka and run the producer, published messages into it. 我在apache kafka中创建了一个主题“示例”,并运行了生产者,并向其中发布了消息。 I run consumer in other terminal able to see the published messages. 我在其他能够运行已发布消息的终端上运行消费者。 now I want to display messgaes in Grid using Angularjs. 现在我想使用Angularjs在Grid中显示消息。 Is there way to consume messages and display as table ? 有没有办法消费消息并显示为表格?

AngularJS is a client side technology, whereas Kafka is a server side. AngularJS是客户端技术,而Kafka是服务器端。

One way you can achieve this is by creating a kafka consumer, with which will send result to websockets. 实现此目标的一种方法是创建一个kafka使用者,使用该使用者将结果发送到websockets。 And this socket is consumed by angular. 并且这个插座被角度消耗。

According to the Kafka clients page there's a node.js client. 根据Kafka客户页面,有一个node.js客户。 I haven't used it myself, but the project's github repo seems to be active. 我自己还没有使用过它,但是该项目的github回购似乎很活跃。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM