Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7CC209345 for ; Fri, 3 Feb 2012 10:58:20 +0000 (UTC) Received: (qmail 98778 invoked by uid 500); 3 Feb 2012 10:58:20 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 98448 invoked by uid 500); 3 Feb 2012 10:58:18 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 98367 invoked by uid 99); 3 Feb 2012 10:58:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2012 10:58:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2012 10:58:15 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 95C1018B2E4 for ; Fri, 3 Feb 2012 10:57:54 +0000 (UTC) Date: Fri, 3 Feb 2012 10:57:54 +0000 (UTC) From: "metatech (Commented) (JIRA)" To: dev@activemq.apache.org Message-ID: <554891142.7007.1328266674615.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1983245207.11863.1328024350144.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (AMQ-3692) ActiveMQ OSGi bundle should be stopped when broker stops itself MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AMQ-3692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13199638#comment-13199638 ] metatech commented on AMQ-3692: ------------------------------- Here is a new version of the patch, that prevents self-deadlock and also adds two properties ("minUptime" and "restartDelay"). > ActiveMQ OSGi bundle should be stopped when broker stops itself > --------------------------------------------------------------- > > Key: AMQ-3692 > URL: https://issues.apache.org/jira/browse/AMQ-3692 > Project: ActiveMQ > Issue Type: Improvement > Components: Broker > Affects Versions: 5.4.2 > Environment: ServiceMix 4.3 > Reporter: metatech > Attachments: BrokerBundleWatcher.patch, BrokerBundleWatcher_v2.patch, BrokerService.patch, activemq-broker.xml > > Original Estimate: 1h > Remaining Estimate: 1h > > In case of error, the ActiveMQ broker can stop itself. > In an OSGi/Blueprint environment, the bundle is however still in Active/Created state, which misleads an external monitoring software into thinking that the broker is running fine. > This patch stops the bundle when the broker stops itself. > This patch can also auto-restart the bundle, which will restart the broker. > This is critical in an Master/Slave configuration : when the connection to the database is lost, the broker cannot maintain the DB exclusive lock, and it stops itself. The bundle should be stopped and started again, so that it enters again the "Creating" state, in which it waits to obtain the DB lock again. > The class "BrokerBundleWatcher" needs to be registered with the "shutdownHooks" property of the ActiveMQ "BrokerService". However, there is a limitation with the XBean syntax in a Blueprint XML, which does not allow to define inner beans. The workaround is to define the "activemq-broker.xml" in full native Blueprint syntax (no XBean). > The patch also provides a modified version of the BrokerService, that injects its own reference into the ShutdownHook's which implement the "BrokerServiceAware" interface. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira