[activemq-user] handling broker disconnection - Listener not working

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[activemq-user] handling broker disconnection - Listener not working

Michał Małecki
Hello,
I'm implementing log4j appender for our stat system. The JMSAppender extends
AppenderSkeleton and implements javax.jsm.ExceptionListener. I register the
listener in the following way (everything in the appender):
connection = connectionFactory.createConnection();
connection.setExceptionListener(this);

Unfortunatelly when the broker is shut down, I see in the log that the
connection is down:

[TcpTransportChannel:
Socket[addr=localhost/127.0.0.1,port=1231,localport=2758]] WARN
java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:333)
at
org.codehaus.activemq.io.impl.DefaultWireFormat.readPacket(DefaultWireFormat
.java:190)
at
org.codehaus.activemq.transport.tcp.TcpTransportChannel.run(TcpTransportChan
nel.java:294)
at java.lang.Thread.run(Thread.java:534)
2005-06-15 11:06:57,529 [TcpTransportChannel:
Socket[addr=localhost/127.0.0.1,port=1231,localport=2758]] INFO

, but the listener is not invoked (and I don't reconnect after that). This
create very serious problem - the appender is pretending to carry on sending
messages (when the broker is again up) but in fact it loose them somewhere
in the producer.send(message);
I use simple tcp protocol and ActiveMQ 2.1. Upgrading from 2.1 to 3 won't be
easy but I can do this, if it's the only solution :(

Best Regards
Micha? Ma?ecki
ps I know that AMQ has it's ownl jmsappender, but it's not what I want


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [activemq-user] handling broker disconnection - Listener not working

jstrachan
There were a few issues found in the last month or so with some  
failures not being properly reported to the Listener when using the  
tcp transport; this has now been resolved in 3.1-M2 and the  
forthcoming 3.1 release.

I'm afraid the only solution right now is to upgrade.

BTW do know about the reliable:tcp://host:port transport which will  
automatically reconnect to the broker automatically for you on broker  
failure?


On 15 Jun 2005, at 10:09, Michał Małecki wrote:

> Hello,
> I'm implementing log4j appender for our stat system. The  
> JMSAppender extends
> AppenderSkeleton and implements javax.jsm.ExceptionListener. I  
> register the
> listener in the following way (everything in the appender):
> connection = connectionFactory.createConnection();
> connection.setExceptionListener(this);
>
> Unfortunatelly when the broker is shut down, I see in the log that the
> connection is down:
>
> [TcpTransportChannel:
> Socket[addr=localhost/127.0.0.1,port=1231,localport=2758]] WARN
> java.io.EOFException
> at java.io.DataInputStream.readByte(DataInputStream.java:333)
> at
> org.codehaus.activemq.io.impl.DefaultWireFormat.readPacket
> (DefaultWireFormat
> .java:190)
> at
> org.codehaus.activemq.transport.tcp.TcpTransportChannel.run
> (TcpTransportChan
> nel.java:294)
> at java.lang.Thread.run(Thread.java:534)
> 2005-06-15 11:06:57,529 [TcpTransportChannel:
> Socket[addr=localhost/127.0.0.1,port=1231,localport=2758]] INFO
>
> , but the listener is not invoked (and I don't reconnect after  
> that). This
> create very serious problem - the appender is pretending to carry  
> on sending
> messages (when the broker is again up) but in fact it loose them  
> somewhere
> in the producer.send(message);
> I use simple tcp protocol and ActiveMQ 2.1. Upgrading from 2.1 to 3  
> won't be
> easy but I can do this, if it's the only solution :(
>
> Best Regards
> Michał Małecki
> ps I know that AMQ has it's ownl jmsappender, but it's not what I want
>
>
>


James
-------
http://radio.weblogs.com/0112098/

Loading...