First off some background info
My company has a software as a service model where people log onto our servers and do work. In order to support that application we have a utility application that lives on the client machine, and copies binary data from our servers to their machines.
The first iteration of this software polled the database and then generated the information on the client side. This approach was done away with because we thought there where some fundamental flaws
- Polling the database to see if any work had to be done
- Opening up our SQL port to the world
- Pulling all the data from the database and generating it on the client side.
Our second iteration of the software generated the data on one of our servers and sent it on to the client via the Java Messaging Service. The advantages being seen as
- Event Driven
- No polling
- SQL port is closed
- Data is not being generated over the WAN
The above is to illustrate the approaches we've used in the past.
The problem that we have is that our clients often have poor connectivity to us (packet loss, poor response times etc) JMS was supposed to handle that as it should reconnect when the line comes back up but this doesn't always happen.
What are the best approaches to deal with poor client connectivity?
To explain what I mean about JMS not working as expected.
My expectation of JMS is that it works reliably. What I mean by this is that if a line goes down, or is losing packets, or misbehaving in any other manner that the JMS implementation will continue to try send the message until it succeeds.
As an example I see on an almost daily basis a JMS queue with consumers attached, yet no messages being sent or received, restarting the client normally resolves the issue.
I can speak about more specifics, however for the sake of this conversation lets leave JMS out as potential answer
I wanted some other possible solutions to my problem, but the general consensus seems to be that my current one (JMS) is the best.
So here are 2 of my current cases where I am having issues with JMS
Client connects to the queue succesfully sends and receives multiple messages, after a variable time (between several hours and several days) the client no longer receives any messages. The main queue shows the consumers connected, but the client never receives the messages. The resolution is to restart the client application
The client never connects to the queue. The client continually tries to reconnect but the reconnection always fails. The resolution for this is to try again in a few hours
Our setup is fairly simple
- One public server
- The clients are low volume, ranging from 10 messages a day to a 1000 messages a day
- Clients never initiate a 'message conversation', the queue initates and the clients reply
- Messages are small, all pure text, no binary data
config is as follows:
connectionFactory = new ConnectionFactory(); connectionFactory.setProperty(ConnectionConfiguration.imqAddressList, connectionURL); connectionFactory.setProperty(ConnectionConfiguration.imqReconnectEnabled, "true"); connectionFactory.setProperty(ConnectionConfiguration.imqPingInterval, "30"); connectionFactory.setProperty(ConnectionConfiguration.imqReconnectAttempts, "-1"); connectionFactory.setProperty(ConnectionConfiguration.imqReconnectInterval, "30000");