You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Bashar Saleh <ba...@ihjez.com> on 2011/10/14 18:22:51 UTC
A client is already connected to durable subscriber
[Setup]
ActiveMQ 5.0
Broker - Ubuntu Linux 10.04
Client - Java client running on Windows
[Problem]
I have an issue with a durable subscription reconnection. When the
client above is disconnected (due to a bad connect, cable disconnection,
loosing connectivity), the client automatically throws an exception and
attempts to reconnect to broker (every 5 seconds). Upon successfully
restoring internet connectivity, the connection requests to the durable
subscription are rejected with exception "Client with id ...... is
already connected". The already connected is the same client which lost
connectivity earlier.
After about 60 second, the broker finally drops the now long gone
connection and the client is finally able to reconnect.
Is there a way to instruct ActiveMQ to accept the new client connection
request from the same IP address with the same unique session ID (part
of client ID) as a continuation of the now gone connection?
Remember, the connection was closed abruptly and not gracefully.
-Bashar
Re: A client is already connected to durable subscriber
Posted by Gary Tully <ga...@gmail.com>.
if you use the failover: transport on the client, it will attempt to
remove the old connection on the broker when it reconnects.
The other thing to look at are the tcp keepAlive settings, set
keepAlive=true on the broker transport connector and configure the OS
to have a lower keepAlive defaults such that the inactive tcp
connection is dropped before 60s.
With a lower keepAlive, the abruptly closed connection will be cleaned
up earlier. The inactivity monitor will help, but not if the broker is
blocked in a write.
On 14 October 2011 17:22, Bashar Saleh <ba...@ihjez.com> wrote:
> [Setup]
> ActiveMQ 5.0
> Broker - Ubuntu Linux 10.04
> Client - Java client running on Windows
>
>
> [Problem]
> I have an issue with a durable subscription reconnection. When the client
> above is disconnected (due to a bad connect, cable disconnection, loosing
> connectivity), the client automatically throws an exception and attempts to
> reconnect to broker (every 5 seconds). Upon successfully restoring internet
> connectivity, the connection requests to the durable subscription are
> rejected with exception "Client with id ...... is already connected". The
> already connected is the same client which lost connectivity earlier.
>
> After about 60 second, the broker finally drops the now long gone connection
> and the client is finally able to reconnect.
>
>
> Is there a way to instruct ActiveMQ to accept the new client connection
> request from the same IP address with the same unique session ID (part of
> client ID) as a continuation of the now gone connection?
>
> Remember, the connection was closed abruptly and not gracefully.
>
> -Bashar
>
--
http://fusesource.com
http://blog.garytully.com
Re: A client is already connected to durable subscriber
Posted by Joe Niski <jo...@nwea.org>.
In AMQ 5.4 (i believe) and later, the NetworkConnector has a
"suppressDuplicateTopicSubscriptions" property that you can set to
"false". Here's my configuration
<networkConnector name="myNetworkConnector"
userName="${networkConnectorUserName}"
password="${networkConnectorPassword}"
uri="static://(ssl://${Central.ServerHostname}:${central_sslPortNumber})?initialReconnectDelay=1000&useExponentialBackOff=false&suppressDuplicateTopicSubscriptions=false"
duplex="true"
dynamicOnly="true">
<dynamicallyIncludedDestinations>
<queue physicalName="my.queues.central.>"/>
<topic physicalName="my.topics.>"/>
</dynamicallyIncludedDestinations>
</networkConnector>
*Joe Niski*
Senior Developer - Information Services | NWEA™
PHONE 503.548.5207 | FAX 503.639.7873
NWEA.ORG <http://www.nwea.org/> | Partnering to help all kids learn™
On 10/14/2011 09:22 AM, Bashar Saleh wrote:
> [Setup]
> ActiveMQ 5.0
> Broker - Ubuntu Linux 10.04
> Client - Java client running on Windows
>
>
> [Problem]
> I have an issue with a durable subscription reconnection. When the
> client above is disconnected (due to a bad connect, cable disconnection,
> loosing connectivity), the client automatically throws an exception and
> attempts to reconnect to broker (every 5 seconds). Upon successfully
> restoring internet connectivity, the connection requests to the durable
> subscription are rejected with exception "Client with id ...... is
> already connected". The already connected is the same client which lost
> connectivity earlier.
>
> After about 60 second, the broker finally drops the now long gone
> connection and the client is finally able to reconnect.
>
>
> Is there a way to instruct ActiveMQ to accept the new client connection
> request from the same IP address with the same unique session ID (part
> of client ID) as a continuation of the now gone connection?
>
> Remember, the connection was closed abruptly and not gracefully.
>
> -Bashar