activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grswinho <>
Subject Activemq-cpp Handling DataInputStream::readLong Reached EOF / Thread Local storage limit reached
Date Thu, 23 Apr 2015 21:17:21 GMT
Hey all,

I am using stomp 1.1 and activemq 3.8.3

I derived some activemq cpp code from the hello producer/consumer example
from here:

This is my connection uri string:

Instead of using the connection once though it needs to stay up for long
periods of time, some of which it might be dormant. After starting the
program, every 20-30 seconds i get the following exception:
DataInputStream::readLong - Reached EOF 
which gets caught by the onException method of the the messageListener
class. I found a post that said when this happens your connection is hosed
and you need to tear down everything (except for the connection factory) and
reconnect everything:

If i try to close the connection or the session at this point i get an error
Expcetion while trying to free resources: Channel was inactive for too long:
        FILE: activemq/core/ActiveMQConnection.cpp, LINE: 1254
        FILE: activemq/core/kernels/ActiveMQSessionKernel.cpp, LINE: 314
        FILE: activemq/core/kernels/ActiveMQSessionKernel.cpp, LINE: 299
        FILE: activemq/core/ActiveMQSession.cpp, LINE: 64

So if instead i just delete the pointers to the connection, session,
destination and consumer and reconnect and run i get the following:
DataInputStream::readLong - Reached EOF 
but when it goes to delete the connection pointer it just dies and doesn't
try to reconnect.

if i delete the session, destination and consumer, then i see this
DataInputStream::readLong - Reached EOF 
until eventually it just stops.

If i don't delete any of the pointers then i get then after a while i get
the following issue:
DataInputStream::readLong - Reached EOF  a lot followed by
Thread Local storage limit reached.

Which i can see from here:
is the result of too many sessions being created - which makes sense since
each time i see the eof i am creating a new session

I guess my question is what is the best way that i should be handling the
eof and is there any better way that I should be cleaning up my resources on
a reconnect.

I guess that I could send a keep alive message to prevent the eof being
triggered but that seems a little wrong

View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message