JMX RMI代理容错机制
我正在使用 JMX-RMI 代理进行消息传递。我有一个java程序,它将具有名称/id的消息发送到一组侦听器/侦听器。根据侦听器收到的消息,客户端程序会做出相应的行为。这一部分工作正常,但我想知道是什么样的容错功能内置于 JMX RMI 代理中。
如果侦听器意外停止,JMX 是否会重新启动它或在某处记录错误,如果两侧的消息队列已满怎么办?任何解释 JMX RMI 底层架构或内置容错机制的文档都将受到赞赏。如果它没有任何容错机制,那么有什么好的方法呢?
非常感谢
I am using the JMX-RMI agent for message passing. I have a java program which sends a message having a name/id to a set of listener/listeners.Based on the message received by the listeners the client side programs behave accordingly.This piece works fine but I would like to know what kind of fault tolerance is built in into the JMX RMI agent.
If the listener stops accidentally, does JMX restart it or logs the error somewhere,what if the message queue on either side is full. Any documentation which explains the underlying architecture of JMX RMI or the in built fault tolerance mechanism will be appreciated. If it doesn't have any fault tolerance mechanisms, what would be a good way of doing it.
Thanks Much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您的客户端侦听器正在使用标准 javax.management.remote 连接器。如果没有一些自定义,我想说您可以实现一些简单的故障检测。对于容错,您可能正在寻找某种集群解决方案。
您需要关注两层连接:
对于#1,客户端进程可以注册 NotificationListener 与 JMXConnector 使用 addConnectionNotificationListener 方法。然后,您的本地连接将发出 JMXConnectionNotifications 发生以下所有事件:
这样,您的客户端就会知道与服务器的连接何时建立和丢失。
对于#2,它对于您的应用程序来说更加具体,但也许您可以采用这样的简单模式:
当您的侦听器/转发器服务启动时,发出启动通知。当它停止时,发出停止通知。注册这些通知的两类侦听器是:
这或多或少是你的想法吗?
I am assuming your client side listeners are using the standard javax.management.remote connectors. Without some customization, I would say you can implement some straightforward Fault Detection. For Fault Tolerance you're probably looking at some sort of clustering solution.
There are two layers of connectivity you need to be concerned about:
For #1, the client processes can register a NotificationListener with the JMXConnector using the addConnectionNotificationListener method. Your local connection will then emit JMXConnectionNotifications on all the following events:
This way, your clients will know when a connection to the server has been established and lost.
For #2, it's a bit more specific to your application, but perhaps you can adapt a simple pattern like this:
When your listener/forwarder service starts, emit a start-notification. When it stops,emit a stopped-notification. The two categories of listeners that would register for these notifications would be:
Is that more-or-less what you were thinking of ?