Reconnecting to an previously established queue causing problems
Hi, I have set up the JMS server such that each queue can have 1 consumer.
Now if there is a network failure and the established again and I try to connect back to the server the command
queueReceiver = queueSession.createReceiver(queue);
throws the error "JMS Destination limit has been reached"
How do I re-establish this connection?
I currently have the standard JMS 3.5, but I've also tried on standard 3.6
any help would be appreciated.
Thnks in advance.
# 1
Are you running with some sort of proxy server ?
If you are, we have seen cases where the client has experienced a network error and reconnected but the connection between the client and broker has not closed (e.g. the broker has not received a timeout exception)
If so - you may be running into 6363810 (or 6176268)
The currently shipping version of MQ does not release its "locks" (queues, clientIDs, etc) until it receives an IOException. We force that for half-open connections by sending pings, however there are situations w/ proxy servers where connection to the broker isnt closed (just the connection from the client to the proxy server).
Until those locks are released, you are stuck
The workaround is to try and have the proxy server timeout the connection faster.
If the workaround wont work and you have a support contact, you can talk to sun support about how to get the patch for this problem
# 2
The application is accessing the JMS server on another machine but it is not a proxy server. As for the network error, it can be as simple as disconnecting the network connection and then re-connecting it.
I am currently running 3.5 on a Windows platform. I've also tried with 3.6 but get the same results.
When a network error occurs I try to re-establish connection to the queue on the server but I get the errror beause the server still believes there is a connection.
I am using the asynchronize receive method.
How then do you send pings from the client application?
Also how do you set up the timeout connection?
# 3
sorry for the delay in replying (its been one of those years)
If you have a support contract - the easiest way to fix this is call support to obtain the service patch which fixes this problem. The patch recognizes when a connection re-connects and the broker believes it is still open and also allows you to set a specific timeout (if the connection hasn't received a response from a ping for some period of time, the connection is closed)
Without the patch:
What has to happen is that the TCP stack needs to recognize that the connection is bad and close it ...
The first step is that you should set the imq.ping.interval property in config.properties (its in seconds). This means that the broker will send out packets every N seconds to any quiet connection (if it received a packet on the connection in the last N seconds, it knows everything is fine)
If you are still seeing 1/2 open connections, you will have to tune the tcp stack to timeout sockets faster
What needs to happen is:
the broker sends data down the "dead" connection