Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 3114 invoked from network); 1 Nov 2006 18:04:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Nov 2006 18:04:21 -0000 Received: (qmail 68325 invoked by uid 500); 1 Nov 2006 18:04:31 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 68310 invoked by uid 500); 1 Nov 2006 18:04:31 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 68301 invoked by uid 99); 1 Nov 2006 18:04:31 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Nov 2006 10:04:31 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Nov 2006 10:04:16 -0800 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GfKRQ-0007O8-GG for activemq-users@geronimo.apache.org; Wed, 01 Nov 2006 10:03:56 -0800 Message-ID: <7119119.post@talk.nabble.com> Date: Wed, 1 Nov 2006 10:03:56 -0800 (PST) From: robottaway To: activemq-users@geronimo.apache.org Subject: AMQ shut down, NMS connection still going! MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: rottaway@musiciansfriend.com X-Virus-Checked: Checked by ClamAV on apache.org I am running a Windows service that connects to AMQ 4.0.2 thourgh the .NET NMS api. It works almost perfect but there seems be one sticking point, which is if I kill AMQ the service keeps on going like nothing happened! I have tried using both Receive() and Receive(span) methods, niether throw exception when AMQ is no longer running. here is a .NET console app I wrote to make testing this easy. Just run it wait for the message "Before Receive()", then kill AMQ. Nothing happens in the app! It seems to think things are still going good. using System; using System.Collections.Generic; using System.Text; using NMS; using ActiveMQ; using ActiveMQ.Commands; using System.Threading; namespace TestKillAmq { class Program { static String connString = "tcp://172.16.10.243:61616"; static String queue = "bsd.development.orderentry"; static void Main(string[] args) { IConnectionFactory factory; Connection amqConnection; Session amqSession; IDestination destination; IMessageConsumer consumer; ActiveMQTextMessage message; factory = new ConnectionFactory(new Uri(connString)); try { amqConnection = (Connection)factory.CreateConnection(); amqSession = (Session)amqConnection.CreateSession(AcknowledgementMode.Transactional); destination = amqSession.GetQueue(queue); consumer = amqSession.CreateConsumer(destination); Console.WriteLine("Before Receive()"); message = (ActiveMQTextMessage)consumer.Receive(); Console.WriteLine("After Receive(), message: " + message.Text); amqSession.Commit(); Console.WriteLine("Commited transaction!"); // shutdown all the stuff consumer.Dispose(); amqSession.Dispose(); amqConnection.Dispose(); Thread.Sleep(5000); } catch (Exception exception) { Console.WriteLine(exception.ToString()); } } } } -- View this message in context: http://www.nabble.com/AMQ-shut-down%2C-NMS-connection-still-going%21-tf2554850.html#a7119119 Sent from the ActiveMQ - User mailing list archive at Nabble.com.