0

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

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

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?

DuncanKinnear
  • 4,563
  • 2
  • 34
  • 65
  • This problem has not re-surfaced since I asked this question, so I believe this was just some sort of transient issue which we have somehow fixed. – DuncanKinnear Aug 05 '14 at 22:00

2 Answers2

0

An easy workaround shall be to override isSingleton() method of CamelProxyFactoryBean. Return false and let spring create the producer bean on every invocation instead of caching it. Or you can also define the scope of CamelProxyFactoryBean to be prototype.

Also you can try with the ActiveMQ camel component that supports connection pooling.

Hussain Pirosha
  • 1,358
  • 1
  • 11
  • 19
0

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

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.

lutfijd
  • 312
  • 1
  • 2
  • 11
  • Yes, this would be possible to do. However, we have designed the system so that the server can be taken down and restarted while the clients are still 'logged in', so while the server is 'rebooting' (several minutes) the client would think that it's side of the JMS 'pipe' has been lost. The original problem has not resurfaced since I asked the question, so I believe this was some sort of transient issue. – DuncanKinnear Aug 05 '14 at 21:59