activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: ACTIVEMQ-CPP. Topic consumer after connection interrupt and restore
Date Fri, 03 Dec 2010 15:41:32 GMT
It sounds like you've run into a bug.  We'd need to build a unit test case
to try and reproduce it.  There's an easier way to break the connection than
using a breakpoints.  You can get the underlying transport from the
connection instance by casting it to an ActiveMQConnection and then calling
getTransport.  From the transport you can then call narrow and use the
typeid of the TcpTransport to get a pointer to the real TcpTransport that's
connected to the broker and call close on it which breaks the connection and
kicks in the Failover logic.  You can take a look at some of the
FailoverTest methods to see how this can be done.

Regards
Tim
www.fusesource.com

On Fri, Dec 3, 2010 at 8:06 AM, Oscar Pernas <oscar@pernas.es> wrote:

> Hi all,
>
> Sorry if I'am missunderstanding something but I have a activemq-cpp topic
> consumer. I am trying to test connection interrupt and restores, and how
> messages are sent to a durable topic. To do this, I've put a breakpoint in
> my code after connect to broker. Some time later, I've press to continue
> executing the program and I receive a connection interrupt and a connection
> restore like this:
>
>
> - Created consumer, and received two messages:
>
> 2010-12-03 13:48:53 DEBUG (ActiveConsumer:202) - ActiveConsumer::run.
> Consumer is started succesfully: 1
> 2010-12-03 13:48:53 INFO  (ActiveManager:1076) - Started connection id 1
> succesfully.
> Message received: 0 from connection 2FIPASO1111116E0
> Message received: 0 from connection 2FIPASO1111116E1
>
>
> Stopped by the breakpoint and received interrupt and restore:
>
>
> 2010-12-03 14:00:27 DEBUG (ActiveConsumer:559) -
> Producer::transportInterrupted. The Connection's Transport has been
> interrupted.consumer1
> ERROR: Received on onConnectionInterrupted from 1
> 2010-12-03 14:00:27 DEBUG (ActiveConsumer:577) -
> Producer::transportResumed.
> The Connection's Transport has been Restored.consumer1
> ERROR: Received on onConnectionRestore from 1
>
>
> But after that, I can't receive any message by this topic, It could be a
> bad
> test making a breakpoint, but I'm trying to understand. Any clue?
>
>
> regards
>
>
> --
> Óscar Pernas Plaza.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message