activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oagady <oag...@gmail.com>
Subject Re: Shutting down ActiveMQ kills topic subscriber client
Date Fri, 29 Jul 2011 16:30:19 GMT
Hi, Gary

Thanks for your reply. I ran examples, and both the producer and consumer
processes exited when I shut down ActiveMQ. The following is the exception
from the consumer console:

2011...' (length 1000)
     [java] [Thread-2] Received: 'Message: 924 sent at: Fri Jul 29 12:08:30
EDT
2011...' (length 1000)
     [java] [Thread-2] Received: 'Message: 925 sent at: Fri Jul 29 12:08:30
EDT
2011...' (length 1000)
     [java] [Thread-2] Received: 'Message: 926 sent at: Fri Jul 29 12:08:30
EDT
2011...' (length 1000)
     [java] [Thread-2] JMS Exception occured.  Shutting down client.
     [java] [Thread-2] Caught: javax.jms.JMSException: java.io.EOFException
     [java] javax.jms.JMSException: java.io.EOFException
     [java]     at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExcept
ionSupport.java:62)
     [java]     at
org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQM
essageConsumer.java:458)
     [java]     at
org.apache.activemq.ActiveMQMessageConsumer.receive(ActiveMQM
essageConsumer.java:577)
     [java]     at ConsumerTool.consumeMessagesAndClose(Unknown Source)
     [java]     at ConsumerTool.run(Unknown Source)
     [java] Caused by: java.io.EOFException
     [java]     at java.io.DataInputStream.readInt(DataInputStream.java:375)
     [java]     at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWir
eFormat.java:269)
     [java]     at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(Tc
pTransport.java:227)
     [java]     at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTrans
port.java:219)
     [java]     at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTranspo
rt.java:202)
     [java]     at java.lang.Thread.run(Thread.java:662)
     [java] All threads completed their work

BUILD SUCCESSFUL
Total time: 34 seconds

C:\Tools\apache-activemq-5.5.0\example>


My problem is that I need consumer to run all the time, and survive the
ActiveMQ reboot.

I enabled debug statement for activemq libraries (on my own consumer), and
the last messages I see (after I shut down ActiveMQ, and my consumer exits)
is:

2011-07-28 17:04:52,062 | INFO  |
(org.apache.activemq.transport.failover.FailoverTransport:doReconnect:891)
Successfully connected to tcp://10.1.4.142:61616

2011-07-28 17:05:01,234 | DEBUG |
(org.apache.activemq.transport.tcp.TcpTransport:doStop:508)
Stopping transport tcp:///10.1.4.142:61616

2011-07-28 17:05:01,234 | WARN  |
(org.apache.activemq.transport.failover.FailoverTransport:handleTransportFailure:231)
Transport (/10.1.4.142:61616) failed to tcp://10.1.4.142:61616 , attempting
to automatically reconnect due to: java.io.EOFException

2011-07-28 17:05:01,234 | DEBUG |
(org.apache.activemq.transport.failover.FailoverTransport:handleTransportFailure:233)
Transport failed with the following exception:

java.io.EOFException
	at java.io.DataInputStream.readInt(Unknown Source)
	at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
	at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:227)
	at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:219)
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
	at java.lang.Thread.run(Unknown Source)
2011-07-28 17:05:01,234 | DEBUG |
(org.apache.activemq.transport.failover.FailoverTransport:getConnectList:683)
urlList connectionList:[tcp://10.1.4.142:61616], from:
[tcp://10.1.4.142:61616]

*2011-07-28 17:05:01,234 | DEBUG |
(org.apache.activemq.transport.failover.FailoverTransport:doReconnect:855)
Attempting connect to: tcp://10.1.4.142:61616*


I looked at the source code of ActiveMQ's *FailoverTransport.java* class
(*doReconnect* method), and I see that after that message I either should
see the exception caught by try/catch block (that connection failed), or a
message that connection was successful. So, I am supposed to get the
exception message since I shut down the broker, but I don't get it. Looks
like the JVM exists on the  spot somewhere between the lines:

SslContext.setCurrentSslContext(brokerSslContext);
t = TransportFactory.compositeConnect(uri);
t.setTransportListener(myTransportListener);
t.start();

if (started) {
    restoreTransport(t);
}


I am running ActiveMQ 5.5 on Java 1.6.0.24. May be I should try a different
JVM version

Gali


--
View this message in context: http://activemq.2283324.n4.nabble.com/Shutting-down-ActiveMQ-kills-topic-subscriber-client-tp3699908p3704587.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message