如何检测JMS主题连接丢失 [英] How to detect loss of JMS Topic connection

查看:213
本文介绍了如何检测JMS主题连接丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个连接到一个服务器进程Swing GUI的客户。

We have swing GUI clients that are connecting to a server process.

客户的呼叫'使用 JMS服务器上的服务:队列'的'骆驼路线定义端点,并使用ActiveMQ的作为底层JMS代理

The clients 'call' services on the server using jms:queue 'from' endpoints defined in Camel routes, and using ActiveMQ as the underlying JMS broker.

但是,客户端还提供了一个骆驼 JMS:题目终端服务器广播消息返回给客户端

However, the client also offers a Camel jms:topic endpoint for the server to broadcast messages back to the client.

不幸的是,它看起来像主题连接是越来越不知何故而丢失,虽然客户仍可以呼叫服务器上的服务,服务器无法发送任何信息到客户端的话题终结点。

Unfortunately, it looks like the topic connection is getting lost somehow, and although the client can still 'call' the services on the server, the server cannot send any messages to the client's topic endpoint.

骆驼端点的客户端春天定义如下:

The client-side spring definition of the Camel endpoint is as follows:

    <camel:route>
        <camel:from uri="jms:topic:inUseQueue"/>
        <camel:to uri="bean:inUseInterfaceImpl"/>
    </camel:route>

和服务器端生产者定义如下:

And the server-side producer is defined as follows:

<bean id="inUseManagerImpl" class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">
  <property name="serviceUrl" value="jms:topic:inUseQueue"/>
  <property name="serviceInterface" value="uniworks.core.inuse.InUseInterface"/>
</bean>

有谁知道的一种方式,我们可以以某种方式检测客户端上的这一主题相关的损失?

Does anyone know of a way that we can somehow detect the loss of this topic connection on the client side?

推荐答案

我意识到这是8个月大的问题,但嘿什么是地狱。

I realize this is a 8 month old question, but hey what the hell.

这将使意义使服务器广播的IsAlive的消息一分钟一次,这样,如果客户没有得到任何的的IsAlive的消息就可以presume已断开连接的。

would it make sense to make the server broadcast "isalive" message once a minute, this way if the client doesn't get any of the "isalive" messages it can presume it has been disconnected.

这篇关于如何检测JMS主题连接丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆