On 04/23/2015 05:17 PM, grswinho wrote:
> Hey all,
>
> I am using stomp 1.1 and activemq 3.8.3
The ActiveMQ-CPP project focuses mostly on being used for OpenWire
connectivity to the broker, the STOMP support is a bit neglected these
days.  Do you actually need to use STOMP for some reason? 

> I derived some activemq cpp code from the hello producer/consumer example
> from here: http://activemq.apache.org/cms/example.html
>
> This is my connection uri string:
> tcp://127.0.0.1:6161?wireFormat=stomp&wireFormat.maxInactivityDuration=-1
>
> 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:
> http://activemq.2283324.n4.nabble.com/amq-cpp-cms-ExceptionListener-onException-and-what-one-can-do-there-td4664483.html
>
> If i try to close the connection or the session at this point i get an error
> saying:
> 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
> repeatedly:
> 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:
> http://stackoverflow.com/questions/25125565/activemq-cpp-throws-thread-local-storage-limit-reached-when-sending
> 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: 
> http://activemq.2283324.n4.nabble.com/Activemq-cpp-Handling-DataInputStream-readLong-Reached-EOF-Thread-Local-storage-limit-reached-tp4695548.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>


-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.b...@redhat.com | www.redhat.com 
twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply via email to