Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 086DD200CA9 for ; Fri, 16 Jun 2017 15:56:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 070E4160BEB; Fri, 16 Jun 2017 13:56:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4E4B9160BD2 for ; Fri, 16 Jun 2017 15:56:03 +0200 (CEST) Received: (qmail 57150 invoked by uid 500); 16 Jun 2017 13:56:02 -0000 Mailing-List: contact issues-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 issues@activemq.apache.org Received: (qmail 57141 invoked by uid 99); 16 Jun 2017 13:56:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jun 2017 13:56:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 29F02C041E for ; Fri, 16 Jun 2017 13:56:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.211 X-Spam-Level: X-Spam-Status: No, score=-99.211 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 0XWtq3SYiZp4 for ; Fri, 16 Jun 2017 13:56:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 581EF5FC4D for ; Fri, 16 Jun 2017 13:56:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C96EEE0D6A for ; Fri, 16 Jun 2017 13:56:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2711724004 for ; Fri, 16 Jun 2017 13:56:00 +0000 (UTC) Date: Fri, 16 Jun 2017 13:56:00 +0000 (UTC) From: "Christopher L. Shannon (JIRA)" To: issues@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMQ-6706) Allow for hooks before broker stop occurs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 16 Jun 2017 13:56:04 -0000 [ https://issues.apache.org/jira/browse/AMQ-6706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16051931#comment-16051931 ] Christopher L. Shannon commented on AMQ-6706: --------------------------------------------- Having a pre hook seems ok to me but I would modify the pull request so that it follows the same pattern as the already existing addShutdownHook() and removeShutdownHook() methods. So I think it should be renamed from preStopHooks to preShutdownHooks and be made final, etc. And also have the same synchronization that addShutdownHook() and removeShutdownHook() methods have inside of addPreShutdownHook() and removePreShutdownHook() methods. Lastly, the iteration over the preShutdownHooks should be moved to after the stopping.compareAndSet(false, true) check in the stop() method and be synchronized and have try/catch blocks. Take a look at how shutdownHooks is iterated over inside of stop() already. > Allow for hooks before broker stop occurs > ----------------------------------------- > > Key: AMQ-6706 > URL: https://issues.apache.org/jira/browse/AMQ-6706 > Project: ActiveMQ > Issue Type: Improvement > Components: activemq-camel, Broker > Environment: Every ActiveMQ version with embedded Camel > Reporter: Zoran Regvart > > When Camel is run embedded within ActiveMQ it's shutdown is called at the point the broker is already stopped, this can lead to data loss as there could be exchanges that have not ended. > I propose a preStopHook(s) that can be invoked during ActiveMQ shutdown but before the broker is shutdown. > This would allow Camel to gracefully shutdown while the broker is still started. -- This message was sent by Atlassian JIRA (v6.4.14#64029)