简体   繁体   English

当 kafka 生产者在线或离线时获取通知

[英]get notifications when kafka producer is online or offline

I'm building a website using springboot as RestAPI and angular in frontend.我正在使用 springboot 作为 RestAPI 和 angular 在前端构建一个网站。 Also, i will be getting data in my rest(consumer) from around 40-50 swing standalone apps(producers) through kafka.此外,我将通过 kafka 从大约 40-50 个 swing 独立应用程序(生产者)中获取我休息(消费者)的数据。 I need to implement online status for those swing apps.我需要为那些 swing 应用程序实现在线状态。 Basically, i need to know when and which one of swing apps went offline or back online.基本上,我需要知道 swing 应用程序何时以及哪一个离线或重新在线。 Is there a way to implement this?有没有办法实现这个? If this is impossible with kafka can you recommend something else for communication?如果卡夫卡无法做到这一点,您能否推荐其他东西进行交流?

Clarification: By online status i mean whether device on which swing app is installed has internet connection or not.澄清:在线状态是指安装 swing 应用程序的设备是否有互联网连接。 Swing app will be installed on around 40-50 devices on remote locations. Swing 应用程序将安装在远程位置的大约 40-50 台设备上。

Eventually i got rid of kafka and used websockets.最终我摆脱了 kafka 并使用了 websockets。 Using WebSocketHandler i had information when certain standalone app is connected or disconnected.使用WebSocketHandler当某些独立应用程序连接或断开连接时,我有信息。 When standalone app looses internet connection server is notified relatively quickly (within 60 seconds).当独立应用程序失去互联网连接时,服务器会相对快速地得到通知(在 60 秒内)。 Keep in mind that in my case standalone app will be sending data quite often.请记住,在我的情况下,独立应用程序将经常发送数据。 If this is not the case for you then i recommend looking for some other solutions and taking a look at @OneCriketeer comment regarding Nagios.如果您不是这种情况,那么我建议您寻找一些其他解决方案并查看@OneCriketeer 关于 Nagios 的评论。

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

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