-
1. Re: TopicConnection.close() Hangs When Reconnect Attempts = -1
clebert.suconic Feb 25, 2010 9:08 AM (in response to schwanitzb)With -1 you're basically telling it to keep trying until the connection to your server is back. So, it's doing what it is supposed to do.
Say you temporarily missed the connection to the server. It needs to finish the operation accordingly to what you configured.
-
2. Re: TopicConnection.close() Hangs When Reconnect Attempts = -1
schwanitzb Feb 25, 2010 11:18 AM (in response to clebert.suconic)Clebert,
In my case, the app is just hanging out listening to a topic. Even if the HornetQ server is down, I need to be able to exit. Any suggestions?
Thanks,
Bill
-
3. Re: TopicConnection.close() Hangs When Reconnect Attempts = -1
clebert.suconic Feb 25, 2010 11:21 AM (in response to schwanitzb)The client doesn't know the server is down. You're telling your client to keep trying the reconnection.
If you need a different behaviour, use a different reconnect attempt value.
-
4. Re: TopicConnection.close() Hangs When Reconnect Attempts = -1
schwanitzb Feb 25, 2010 11:34 AM (in response to clebert.suconic)Well, I guess I want it both ways - I'm greedy that way :-)
I want the reconnect logic to do its thing during normal opearation of the app. But I also want the close() method to return when the app is trying to exit.
I guess what you are telling me is there is no way to get both of those at the same time.
Is it possible to add an exception listener and have the app reconnect when the server goes down? I pursued this approach, but, based on the exception sent to the app, the app cannot discriminate between:
a. the server (in a non-primary/backup configuration) going down (in which case, it should try to reconnect), and
b the primary server in a primary/backup configuration going down and HornetQ handling the switchover to the backup (in which case, it should NOT try to reconnect)
In each scenario, my apps exception listener receives this exception: javax.jms.JMSException: HornetQException[errorCode=4 message=The connection was disconnected because of server shutdown].
Cheers,
Bill
-
5. Re: TopicConnection.close() Hangs When Reconnect Attempts = -1
clebert.suconic Feb 25, 2010 12:17 PM (in response to schwanitzb)When you do a close, the client will close consumers on the servers, delete temporary queues if used.. and other cleanup that are needed.
You probably need this for a test scenario. If you had it both ways you would eventually break your production use case.
-
6. Re: TopicConnection.close() Hangs When Reconnect Attempts = -1
timfox Feb 25, 2010 2:11 PM (in response to clebert.suconic)Actually - I'm with Bill on this one.
If a user calls close() on a connection it should terminate it's retry logic and exit.
This wouldn't be hard to do.
Bill, you could add a JIRA feature request for this...
-
7. Re: TopicConnection.close() Hangs When Reconnect Attempts = -1
schwanitzb Feb 26, 2010 12:45 PM (in response to timfox)Tim & Clebert,
Thanks for your responses.
I created a bug report in JIRA: https://jira.jboss.org/jira/browse/HORNETQ-315
Cheers,
Bill