You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jason Rosenberg <jr...@shopzilla.com> on 2008/02/03 00:26:03 UTC

Re: ActiveMQ 5: Keepalive problems

Hi,

I am having the same issue, this doesn't appear fixed, to me....

I'm using a 5.1-SNAPSHOT dated 1/31....

With this broker uri:

failover:(tcp://localhost:61616,tcp://localhost:61617)?initialReconnectDelay=20&maxReconnectDelay=900&randomize=false

I get this error, if I try to use a connection that idles more than 30
seconds:

DEBUG [2008-02-02 18:21:16,927] thread:http-8080-exec-2                   
FailoverTransport -- Stopped.
WARN  [2008-02-02 18:21:16,928] thread:ActiveMQ Transport:
tcp://localhost/127.0.0.1:61616              FailoverTransport -- Transport
failed, attempting to automatically reconnect due to:
java.net.SocketException: Socket closed
java.net.SocketException: Socket closed
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
        at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
        at java.io.DataInputStream.readInt(DataInputStream.java:351)
        at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:267)
        at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:203)
        at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:195)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183)
        at java.lang.Thread.run(Thread.java:637)
DEBUG [2008-02-02 18:21:16,937] thread:http-8080-exec-2                   
FailoverTransport -- Waking up reconnect task
DEBUG [2008-02-02 18:21:16,937] thread:http-8080-exec-2                   
FailoverTransport -- Started.
DEBUG [2008-02-02 18:21:16,937] thread:http-8080-exec-2                   
FailoverTransport -- Waking up reconnect task
DEBUG [2008-02-02 18:21:16,939] thread:ActiveMQ Task                      
FailoverTransport -- Attempting connect to: tcp://localhost:61616
DEBUG [2008-02-02 18:21:16,942] thread:ActiveMQ Task                      
FailoverTransport -- Connection established
INFO  [2008-02-02 18:21:16,942] thread:ActiveMQ Task                      
FailoverTransport -- Successfully connected to tcp://localhost:61616

Jason



rajdavies wrote:
> 
> 
> On Jan 21, 2008, at 9:58 AM, corcorda wrote:
> 
>>
>> We've been using ActiveMQ 4.1.1 for several months and it works  
>> well. I'm
>> looking at upgrading to version 5 to make use of some bug fixes and  
>> I'm
>> having trouble.
>>
>> The main problem is inactivity exceptions keep happening. The exact
>> exception is at the bottom of this message. I haven't changed the  
>> connection
>> string from v4.1.1 and it works fine there. It will work if I disable
>> inactivity duration (set it to 0) but that means the broker doesn't  
>> know
>> when I've disconnected. So, without disabling the inactivity monitor  
>> is
>> there a way of making this work as it did in version4.1.1?
>>
>> From looking at the InactivityMonitor it looks like it should send a
>> KeepAliveInfo message at half the inactivity duration. Perhaps the  
>> broker
>> isn't sending a response back? Or perhaps it's not sending a  
>> response back
>> in time?
>>
>> Something interesting and slightly related is that the  
>> FailoverTransport
>> doesn't reconnect correctly after being left run for a long time. I  
>> let it
>> run over the weekend where it reconnected lots of times but this  
>> morning the
>> blocking receive didn't pick up new messages in the message queue.  
>> Before
>> the weekend it worked fine, even after a failover reconnect.
>>
>> Any help would be great.
>>
>> Thanks.
>>
>> 21 Jan 09:04:20 WARN  [ActiveMQ: Inactivity Handler:
>> localhost/127.0.0.1:1616] FailoverTransport  - Transport failed,  
>> attempting
>> to automatically reconnect due to:
>> org.apache.activemq.transport.InactivityIOException: Channel was  
>> inactive
>> for too long: localhost/127.0.0.1:1616
>> org.apache.activemq.transport.InactivityIOException: Channel was  
>> inactive
>> for too long: localhost/127.0.0.1:1616
>> 	at
>> org.apache.activemq.transport.InactivityMonitor 
>> $4.run(InactivityMonitor.java:108)
>> 21 Jan 09:04:20 WARN  [ActiveMQ Transport: tcp://localhost/ 
>> 127.0.0.1:1616]
>> FailoverTransport  - Transport failed, attempting to automatically  
>> reconnect
>> due to: java.net.SocketException: Socket closed
>> java.net.SocketException: Socket closed
>> 	at java.net.SocketInputStream.socketRead0(Native Method)
>> 	at java.net.SocketInputStream.read(SocketInputStream.java:129)
>> 	at
>> org 
>> .apache 
>> .activemq 
>> .transport 
>> .tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
>> 	at
>> org 
>> .apache 
>> .activemq 
>> .transport 
>> .tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
>> 	at java.io.DataInputStream.readInt(DataInputStream.java:353)
>> 	at
>> org 
>> .apache 
>> .activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)
>> 	at
>> org 
>> .apache 
>> .activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java: 
>> 192)
>> 	at
>> org 
>> .apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java: 
>> 184)
>> 	at
>> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java: 
>> 172)
>> 	at java.lang.Thread.run(Thread.java:595)
>> 21 Jan 09:04:20 INFO  [ActiveMQ Task] FailoverTransport$1  -  
>> Successfully
>> reconnected to tcp://localhost:1616? 
>> wireFormat.maxInactivityDuration=5000
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/ActiveMQ-5%3A-Keepalive-problems-tp14994260s2354p14994260.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> This is fixed in the latest snapshot version
> 
> cheers,
> 
> Rob
> 
> 
> 
> Rob Davies
> 'Go further faster with Apache Camel!'
> http://rajdavies.blogspot.com/
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ-5%3A-Keepalive-problems-tp14994260s2354p15248664.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ 5: Keepalive problems

Posted by Rob Davies <ra...@gmail.com>.
Thanks Jason - will take a look!

cheers,

Rob
On Feb 7, 2008, at 6:04 AM, Jason Rosenberg wrote:

>
> All,
>
> In my case, the issue is related to using connection pooling, which  
> don't
> expose the idleTimeout property...
>
> I've created a work-around outlined in AMQ-1578, which is specific  
> to the
> connection pooling case.
>
> Now my sessions stay alive....
>
> Jason
>
>
>
> Jason Rosenberg wrote:
>>
>> Hi,
>>
>> I am having the same issue, this doesn't appear fixed, to me....
>>
>> I'm using a 5.1-SNAPSHOT dated 1/31....
>>
>> With this broker uri:
>>
>> failover:(tcp://localhost:61616,tcp://localhost:61617)? 
>> initialReconnectDelay=20&maxReconnectDelay=900&randomize=false
>>
>> I get this error, if I try to use a connection that idles more than  
>> 30
>> seconds:
>>
>> DEBUG [2008-02-02 18:21:16,927] thread:http-8080-exec-2
>> FailoverTransport -- Stopped.
>> WARN  [2008-02-02 18:21:16,928] thread:ActiveMQ Transport:
>> tcp://localhost/127.0.0.1:61616              FailoverTransport --
>> Transport failed, attempting to automatically reconnect due to:
>> java.net.SocketException: Socket closed
>> java.net.SocketException: Socket closed
>>        at java.net.SocketInputStream.socketRead0(Native Method)
>>        at java.net.SocketInputStream.read(SocketInputStream.java:129)
>>        at
>> org 
>> .apache 
>> .activemq 
>> .transport 
>> .tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
>>        at
>> org 
>> .apache 
>> .activemq 
>> .transport 
>> .tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
>>        at java.io.DataInputStream.readInt(DataInputStream.java:351)
>>        at
>> org 
>> .apache 
>> .activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:267)
>>        at
>> org 
>> .apache 
>> .activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java: 
>> 203)
>>        at
>> org 
>> .apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java: 
>> 195)
>>        at
>> org 
>> .apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java: 
>> 183)
>>        at java.lang.Thread.run(Thread.java:637)
>> DEBUG [2008-02-02 18:21:16,937] thread:http-8080-exec-2
>> FailoverTransport -- Waking up reconnect task
>> DEBUG [2008-02-02 18:21:16,937] thread:http-8080-exec-2
>> FailoverTransport -- Started.
>> DEBUG [2008-02-02 18:21:16,937] thread:http-8080-exec-2
>> FailoverTransport -- Waking up reconnect task
>> DEBUG [2008-02-02 18:21:16,939] thread:ActiveMQ Task
>> FailoverTransport -- Attempting connect to: tcp://localhost:61616
>> DEBUG [2008-02-02 18:21:16,942] thread:ActiveMQ Task
>> FailoverTransport -- Connection established
>> INFO  [2008-02-02 18:21:16,942] thread:ActiveMQ Task
>> FailoverTransport -- Successfully connected to tcp://localhost:61616
>>
>> Jason
>>
>>
>>
>> rajdavies wrote:
>>>
>>>
>>> On Jan 21, 2008, at 9:58 AM, corcorda wrote:
>>>
>>>>
>>>> We've been using ActiveMQ 4.1.1 for several months and it works
>>>> well. I'm
>>>> looking at upgrading to version 5 to make use of some bug fixes and
>>>> I'm
>>>> having trouble.
>>>>
>>>> The main problem is inactivity exceptions keep happening. The exact
>>>> exception is at the bottom of this message. I haven't changed the
>>>> connection
>>>> string from v4.1.1 and it works fine there. It will work if I  
>>>> disable
>>>> inactivity duration (set it to 0) but that means the broker doesn't
>>>> know
>>>> when I've disconnected. So, without disabling the inactivity  
>>>> monitor
>>>> is
>>>> there a way of making this work as it did in version4.1.1?
>>>>
>>>> From looking at the InactivityMonitor it looks like it should  
>>>> send a
>>>> KeepAliveInfo message at half the inactivity duration. Perhaps the
>>>> broker
>>>> isn't sending a response back? Or perhaps it's not sending a
>>>> response back
>>>> in time?
>>>>
>>>> Something interesting and slightly related is that the
>>>> FailoverTransport
>>>> doesn't reconnect correctly after being left run for a long time. I
>>>> let it
>>>> run over the weekend where it reconnected lots of times but this
>>>> morning the
>>>> blocking receive didn't pick up new messages in the message queue.
>>>> Before
>>>> the weekend it worked fine, even after a failover reconnect.
>>>>
>>>> Any help would be great.
>>>>
>>>> Thanks.
>>>>
>>>> 21 Jan 09:04:20 WARN  [ActiveMQ: Inactivity Handler:
>>>> localhost/127.0.0.1:1616] FailoverTransport  - Transport failed,
>>>> attempting
>>>> to automatically reconnect due to:
>>>> org.apache.activemq.transport.InactivityIOException: Channel was
>>>> inactive
>>>> for too long: localhost/127.0.0.1:1616
>>>> org.apache.activemq.transport.InactivityIOException: Channel was
>>>> inactive
>>>> for too long: localhost/127.0.0.1:1616
>>>> 	at
>>>> org.apache.activemq.transport.InactivityMonitor
>>>> $4.run(InactivityMonitor.java:108)
>>>> 21 Jan 09:04:20 WARN  [ActiveMQ Transport: tcp://localhost/
>>>> 127.0.0.1:1616]
>>>> FailoverTransport  - Transport failed, attempting to automatically
>>>> reconnect
>>>> due to: java.net.SocketException: Socket closed
>>>> java.net.SocketException: Socket closed
>>>> 	at java.net.SocketInputStream.socketRead0(Native Method)
>>>> 	at java.net.SocketInputStream.read(SocketInputStream.java:129)
>>>> 	at
>>>> org
>>>> .apache
>>>> .activemq
>>>> .transport
>>>> .tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
>>>> 	at
>>>> org
>>>> .apache
>>>> .activemq
>>>> .transport
>>>> .tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
>>>> 	at java.io.DataInputStream.readInt(DataInputStream.java:353)
>>>> 	at
>>>> org
>>>> .apache
>>>> .activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java: 
>>>> 268)
>>>> 	at
>>>> org
>>>> .apache
>>>> .activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:
>>>> 192)
>>>> 	at
>>>> org
>>>> .apache 
>>>> .activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:
>>>> 184)
>>>> 	at
>>>> org 
>>>> .apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:
>>>> 172)
>>>> 	at java.lang.Thread.run(Thread.java:595)
>>>> 21 Jan 09:04:20 INFO  [ActiveMQ Task] FailoverTransport$1  -
>>>> Successfully
>>>> reconnected to tcp://localhost:1616?
>>>> wireFormat.maxInactivityDuration=5000
>>>>
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/ActiveMQ-5%3A-Keepalive-problems-tp14994260s2354p14994260.html
>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>>
>>>
>>> This is fixed in the latest snapshot version
>>>
>>> cheers,
>>>
>>> Rob
>>>
>>>
>>>
>>> Rob Davies
>>> 'Go further faster with Apache Camel!'
>>> http://rajdavies.blogspot.com/
>>>
>>>
>>>
>>>
>>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/ActiveMQ-5%3A-Keepalive-problems-tp14994260s2354p15327950.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: ActiveMQ 5: Keepalive problems

Posted by Jason Rosenberg <jr...@shopzilla.com>.
All,

In my case, the issue is related to using connection pooling, which don't
expose the idleTimeout property...

I've created a work-around outlined in AMQ-1578, which is specific to the
connection pooling case.

Now my sessions stay alive....

Jason



Jason Rosenberg wrote:
> 
> Hi,
> 
> I am having the same issue, this doesn't appear fixed, to me....
> 
> I'm using a 5.1-SNAPSHOT dated 1/31....
> 
> With this broker uri:
> 
> failover:(tcp://localhost:61616,tcp://localhost:61617)?initialReconnectDelay=20&maxReconnectDelay=900&randomize=false
> 
> I get this error, if I try to use a connection that idles more than 30
> seconds:
> 
> DEBUG [2008-02-02 18:21:16,927] thread:http-8080-exec-2                   
> FailoverTransport -- Stopped.
> WARN  [2008-02-02 18:21:16,928] thread:ActiveMQ Transport:
> tcp://localhost/127.0.0.1:61616              FailoverTransport --
> Transport failed, attempting to automatically reconnect due to:
> java.net.SocketException: Socket closed
> java.net.SocketException: Socket closed
>         at java.net.SocketInputStream.socketRead0(Native Method)
>         at java.net.SocketInputStream.read(SocketInputStream.java:129)
>         at
> org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
>         at
> org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
>         at java.io.DataInputStream.readInt(DataInputStream.java:351)
>         at
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:267)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:203)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:195)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183)
>         at java.lang.Thread.run(Thread.java:637)
> DEBUG [2008-02-02 18:21:16,937] thread:http-8080-exec-2                   
> FailoverTransport -- Waking up reconnect task
> DEBUG [2008-02-02 18:21:16,937] thread:http-8080-exec-2                   
> FailoverTransport -- Started.
> DEBUG [2008-02-02 18:21:16,937] thread:http-8080-exec-2                   
> FailoverTransport -- Waking up reconnect task
> DEBUG [2008-02-02 18:21:16,939] thread:ActiveMQ Task                      
> FailoverTransport -- Attempting connect to: tcp://localhost:61616
> DEBUG [2008-02-02 18:21:16,942] thread:ActiveMQ Task                      
> FailoverTransport -- Connection established
> INFO  [2008-02-02 18:21:16,942] thread:ActiveMQ Task                      
> FailoverTransport -- Successfully connected to tcp://localhost:61616
> 
> Jason
> 
> 
> 
> rajdavies wrote:
>> 
>> 
>> On Jan 21, 2008, at 9:58 AM, corcorda wrote:
>> 
>>>
>>> We've been using ActiveMQ 4.1.1 for several months and it works  
>>> well. I'm
>>> looking at upgrading to version 5 to make use of some bug fixes and  
>>> I'm
>>> having trouble.
>>>
>>> The main problem is inactivity exceptions keep happening. The exact
>>> exception is at the bottom of this message. I haven't changed the  
>>> connection
>>> string from v4.1.1 and it works fine there. It will work if I disable
>>> inactivity duration (set it to 0) but that means the broker doesn't  
>>> know
>>> when I've disconnected. So, without disabling the inactivity monitor  
>>> is
>>> there a way of making this work as it did in version4.1.1?
>>>
>>> From looking at the InactivityMonitor it looks like it should send a
>>> KeepAliveInfo message at half the inactivity duration. Perhaps the  
>>> broker
>>> isn't sending a response back? Or perhaps it's not sending a  
>>> response back
>>> in time?
>>>
>>> Something interesting and slightly related is that the  
>>> FailoverTransport
>>> doesn't reconnect correctly after being left run for a long time. I  
>>> let it
>>> run over the weekend where it reconnected lots of times but this  
>>> morning the
>>> blocking receive didn't pick up new messages in the message queue.  
>>> Before
>>> the weekend it worked fine, even after a failover reconnect.
>>>
>>> Any help would be great.
>>>
>>> Thanks.
>>>
>>> 21 Jan 09:04:20 WARN  [ActiveMQ: Inactivity Handler:
>>> localhost/127.0.0.1:1616] FailoverTransport  - Transport failed,  
>>> attempting
>>> to automatically reconnect due to:
>>> org.apache.activemq.transport.InactivityIOException: Channel was  
>>> inactive
>>> for too long: localhost/127.0.0.1:1616
>>> org.apache.activemq.transport.InactivityIOException: Channel was  
>>> inactive
>>> for too long: localhost/127.0.0.1:1616
>>> 	at
>>> org.apache.activemq.transport.InactivityMonitor 
>>> $4.run(InactivityMonitor.java:108)
>>> 21 Jan 09:04:20 WARN  [ActiveMQ Transport: tcp://localhost/ 
>>> 127.0.0.1:1616]
>>> FailoverTransport  - Transport failed, attempting to automatically  
>>> reconnect
>>> due to: java.net.SocketException: Socket closed
>>> java.net.SocketException: Socket closed
>>> 	at java.net.SocketInputStream.socketRead0(Native Method)
>>> 	at java.net.SocketInputStream.read(SocketInputStream.java:129)
>>> 	at
>>> org 
>>> .apache 
>>> .activemq 
>>> .transport 
>>> .tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
>>> 	at
>>> org 
>>> .apache 
>>> .activemq 
>>> .transport 
>>> .tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
>>> 	at java.io.DataInputStream.readInt(DataInputStream.java:353)
>>> 	at
>>> org 
>>> .apache 
>>> .activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)
>>> 	at
>>> org 
>>> .apache 
>>> .activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java: 
>>> 192)
>>> 	at
>>> org 
>>> .apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java: 
>>> 184)
>>> 	at
>>> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java: 
>>> 172)
>>> 	at java.lang.Thread.run(Thread.java:595)
>>> 21 Jan 09:04:20 INFO  [ActiveMQ Task] FailoverTransport$1  -  
>>> Successfully
>>> reconnected to tcp://localhost:1616? 
>>> wireFormat.maxInactivityDuration=5000
>>>
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/ActiveMQ-5%3A-Keepalive-problems-tp14994260s2354p14994260.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>> 
>> This is fixed in the latest snapshot version
>> 
>> cheers,
>> 
>> Rob
>> 
>> 
>> 
>> Rob Davies
>> 'Go further faster with Apache Camel!'
>> http://rajdavies.blogspot.com/
>> 
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ-5%3A-Keepalive-problems-tp14994260s2354p15327950.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.