You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Bo <an...@gmail.com> on 2012/08/02 15:29:10 UTC

ActiveMQ - CreateSession failover timeout after a connection is resumed

I'm using ActiveMQ 5.6.0 and ActiveMQ NMS client.

I connect to the broker using the follow code:

var connectionFactory = new ConnectionFactory(
    "failover:(tcp://localhost:61616)?transport.timeout=5000"
    );

connection = connectionFactory.CreateConnection();    
connection.Start();

connection.ConnectionResumedListener += OnConnectionResumed;

Then I stop the broker and start it again. After that in the method
OnConnectionResumed

private void OnConnectionResumed()
{
    var session = connection.CreateSession();

    ...
}

I always get the failover timeout exception when try to create a session.

What am I doing wrong?

Thanks



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-CreateSession-failover-timeout-after-a-connection-is-resumed-tp4654721.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ - CreateSession failover timeout after a connection is resumed

Posted by Bo <an...@gmail.com>.
Hi Tim,

Thank you for your quick reply.

I have tried to invoke session creating in another thread and it works.

Thanks



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-CreateSession-failover-timeout-after-a-connection-is-resumed-tp4654721p4654725.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ - CreateSession failover timeout after a connection is resumed

Posted by Timothy Bish <ta...@gmail.com>.
On Thu, 2012-08-02 at 06:29 -0700, Bo wrote: 
> I'm using ActiveMQ 5.6.0 and ActiveMQ NMS client.
> 
> I connect to the broker using the follow code:
> 
> var connectionFactory = new ConnectionFactory(
>     "failover:(tcp://localhost:61616)?transport.timeout=5000"
>     );
> 
> connection = connectionFactory.CreateConnection();    
> connection.Start();
> 
> connection.ConnectionResumedListener += OnConnectionResumed;
> 
> Then I stop the broker and start it again. After that in the method
> OnConnectionResumed
> 
> private void OnConnectionResumed()
> {
>     var session = connection.CreateSession();
> 
>     ...
> }
> 
> I always get the failover timeout exception when try to create a session.
> 
> What am I doing wrong?
> 
> Thanks
> 

Most likely you are seeing a lock somewhere in the transport stack.  The
resumed call is made in the recovery thread of the Failover transport so
I don't really recommend you try to create connection resources in
there.  You are welcome to debug and submit patches for this if its
needed.

> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-CreateSession-failover-timeout-after-a-connection-is-resumed-tp4654721.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

-- 
Tim Bish
Sr Software Engineer | FuseSource Corp
tim.bish@fusesource.com | www.fusesource.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/