-
1. Re: How to recover from connection failures at client side
atgrohn Sep 1, 2011 1:59 PM (in response to atgrohn)Hi,
Just wanted to clarify more:
I am using this class as part application which carries real time information to time table displays at bus stops over UMTS / GSM network.
If I remove the exceptionListener and the special settings of connectionFactory from my code, it takes (I think) about 90 seconds until the client notices possible connectivity issues at the network connection. If the network connectivy comes back before the 90s limit, the consumer is already gone,
it never receives new messages from the server.
Can I somehow tell to the underlying session that I want my consumer back instead of recreating it?
The producer seems to be alive and kicking after network failure....That makes me wonder.
Antti
-
2. Re: How to recover from connection failures at client side
atgrohn Sep 2, 2011 3:12 PM (in response to atgrohn)Hello,
Any comments welcomed.
If I remove the exeptionListener and reCreateComsumer method and simply initialize the connectionFactory like this
cf.setConnectionTTL(new Long(30000));
cf.setReconnectAttempts(-1);
cf.setRetryInterval(new Long(30000));
cf.setRetryIntervalMultiplier(new Double(1.0));
cf.setMaxRetryInterval(new Long(30000));
cf.setClientFailureCheckPeriod(new Long(30000));Am I doing wrong if I expect that the client will try reconnect forever under any circumstances and after connection has been re-established both the consumer and producer will work?
I am having difficulties in finding any info about reusing the connection, session, consumer and producer over single connection.
I ealier ran the consumer and producer on separate threads and simply closed and reopened the connections on any exception, which is somewhat stupid approach, I think...
Antti
-
3. Re: How to recover from connection failures at client side
clebert.suconic Sep 3, 2011 1:41 AM (in response to atgrohn)Did you look at the confirmation window size for reattachments?
-
4. Re: How to recover from connection failures at client side
atgrohn Sep 3, 2011 4:56 AM (in response to clebert.suconic)Thanks,
I Did not realize this, althouhg red the chapter 34.1 several times:
Setting this parameter to -1 disables any buffering and prevents any re-attachment from occurring, forcing reconnect instead.
The default value for this parameter is -1.
What would be reasonable value for the window size?
What happens if failure is longer than the ConnectionTTL / ClientFailureCheckPeriod, Should I then do something manually or just wait until everything works again.
Antti