Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 72920 invoked from network); 2 Mar 2010 12:15:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Mar 2010 12:15:16 -0000 Received: (qmail 27814 invoked by uid 500); 2 Mar 2010 12:15:12 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 27675 invoked by uid 500); 2 Mar 2010 12:15:12 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 27667 invoked by uid 99); 2 Mar 2010 12:15:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Mar 2010 12:15:12 +0000 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gary.tully@gmail.com designates 209.85.218.219 as permitted sender) Received: from [209.85.218.219] (HELO mail-bw0-f219.google.com) (209.85.218.219) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Mar 2010 12:15:02 +0000 Received: by bwz19 with SMTP id 19so131262bwz.6 for ; Tue, 02 Mar 2010 04:14:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=JHYXQ3cr3jF9MT+F3GRugDMJyuATsZ/LnJ+sMgRLb+g=; b=Bc2PoIbrtGEo8RgGT51br+EfSTW6Ev3SLc/HKRV8olcuWSUKRP2Jye8zvuzXrDding weT9fSVM+J3Z5ZDYtwk7zr7+3STDn9LbKIB3b3CM7+zdCNZKZsaBRgt1wTZ1pLC7Wziy eFP1cxPtXgMXRLlOiTUbTZwaLE9ykBINUzNeE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=BBPMkJAIzZxV8AxYOKZI4+KGbRvnQcBj7XnhXPTBbIi66ODSX+JBuo3K9CP4Eyi5+n WhyfRFOV3UdT3vfxZVkVuR50MvYpInt/GNtLPtYczw/pv/Gv51KqCMtf5zyqz0Cca8ZH 9VxksMTfO5HykP8g80PDBHJQAIfgcR2hK9D8g= MIME-Version: 1.0 Received: by 10.102.206.30 with SMTP id d30mr4805253mug.99.1267532081734; Tue, 02 Mar 2010 04:14:41 -0800 (PST) In-Reply-To: <27752840.post@talk.nabble.com> References: <27752840.post@talk.nabble.com> Date: Tue, 2 Mar 2010 12:14:41 +0000 Message-ID: <3a73c17c1003020414s717bb262uda4f7418a621f97@mail.gmail.com> Subject: Re: Detecting server shutdown - spring DefaultMessageListenerContainer From: Gary Tully To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=0016364169657923140480d04f2b X-Virus-Checked: Checked by ClamAV on apache.org --0016364169657923140480d04f2b Content-Type: text/plain; charset=ISO-8859-1 Don't think there is an easy way. You need to set a ClientInternalExceptionListener on the underlying activemq connection, but there is no easy way to set that via spring as there is no access to the connection. One option would be to provide your own connection factory that can wrap and delegate to the acivemq connectionfactory and set a clientInternalExceptionListener on each returned connection. >From the implementation of the listener you can do what ever you need. Shared instances of transport and exception listeners are already exposed on the connection factory, I think it would make sense to also add a shared clientInternalExceptionListener option also. Could you open a jira issue to track this? On 2 March 2010 07:24, philb1234 wrote: > > Hi, > > We have registered a durable topic consumer using > org.springframework.jms.listener.DefaultMessageListenerContainer. When the > server is shut down or becomes unavailable we would like the consumer to be > notified in some way. > > Currently there is an exception logged in activemq on level debug but the > consumer is not aware that the server is no longer available. Is it > possible to propogate this exception back through spring or register > somehwere in activeMQ to capture this 'server unavailable' event? > > Client is linux activemq 5.2, spring 2.5. Server is linux activemq 5.3 > > Here is the client log when the server is stopped. > > 2010-03-02 17:07:31,063 [taskExecutor-1] DEBUG 2010-03-02 17:07:32,063 > [taskExecutor-1] DEBUG > org.springframework.jms.listener.DefaultMessageListenerContainer - Consumer > [ActiveMQMessageConsumer { value=ID:lab-1-33000-1267511832426-0:2:1:1, > started=true }] of session [PooledSession { ActiveMQSession > {id=ID:lab-1-33000-1267511832426-0:2:1,started=true} }] did not receive a > message > 2010-03-02 17:07:32,704 [ActiveMQ Transport: > tcp://localhost/127.0.0.1:61616] DEBUG > org.apache.activemq.ActiveMQConnection - Async exception with no exception > listener: java.io.EOFException > java.io.EOFException > at java.io.DataInputStream.readInt(DataInputStream.java:375) > at > > org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269) > at > > org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:210) > at > org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:202) > at > org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185) > at java.lang.Thread.run(Thread.java:619) > 2010-03-02 17:07:32,706 [ActiveMQ Connection Worker: > tcp://localhost/127.0.0.1:61616] DEBUG > org.apache.activemq.transport.tcp.TcpTransport - Stopping transport > tcp://localhost/127.0.0.1:61616 > 2010-03-02 17:07:33,063 [taskExecutor-1] DEBUG > org.springframework.jms.listener.DefaultMessageListenerContainer - Consumer > [ActiveMQMessageConsumer { value=ID:lab-1-33000-1267511832426-0:2:1:1, > started=true }] of session [PooledSession { ActiveMQSession > {id=ID:lab-1-33000-1267511832426-0:2:1,started=true} }] did not receive a > message > etc. . . > > Spring durable topic registration > > task-executor="taskExecutor" > > acknowledge="transacted" > > destination-type="durableTopic" > client-id="DLT"> > subscription="durableLogTopic" /> > > > > Thanks > > Cheers, > > Phillip > -- > View this message in context: > http://old.nabble.com/Detecting-server-shutdown---spring-DefaultMessageListenerContainer-tp27752840p27752840.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- http://blog.garytully.com Open Source Integration http://fusesource.com --0016364169657923140480d04f2b--