英文:
get notifications when kafka producer is online or offline
问题
我正在使用Spring Boot作为RestAPI,前端使用Angular构建网站。此外,我将通过Kafka从约40-50个独立的Swing应用程序(生产者)获取数据,并在我的Rest(消费者)中使用。我需要为这些Swing应用程序实现在线状态。基本上,我需要知道Swing应用程序中的哪一个何时下线或重新上线。是否有一种实现这一点的方法?如果使用Kafka不可能实现,您能推荐其他通信方式吗?
澄清:
在线状态是指安装了Swing应用程序的设备是否有互联网连接。
Swing应用程序将安装在远程位置的约40-50台设备上。
英文:
I'm building a website using springboot as RestAPI and angular in frontend. Also, i will be getting data in my rest(consumer) from around 40-50 swing standalone apps(producers) through kafka. I need to implement online status for those swing apps. Basically, i need to know when and which one of swing apps went offline or back online. 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 app will be installed on around 40-50 devices on remote locations.
答案1
得分: 0
最终我摒弃了Kafka,而是使用了Websockets。使用WebSocketHandler,我可以获得某个独立应用连接或断开连接的信息。当独立应用失去互联网连接时,服务器会在相对较短的时间内(60秒内)得到通知。请注意,在我的情况下,独立应用会经常发送数据。如果这不适用于您的情况,我建议寻找其他解决方案,并查看@OneCriketeer关于Nagios的评论。
英文:
Eventually i got rid of kafka and used websockets. Using WebSocketHandler i had information when certain standalone app is connected or disconnected. When standalone app looses internet connection server is notified relatively quickly (within 60 seconds). 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论