activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "metatech (JIRA)" <>
Subject [jira] [Commented] (AMQ-3692) ActiveMQ OSGi bundle should be stopped when broker stops itself
Date Mon, 02 Sep 2013 14:35:53 GMT


metatech commented on AMQ-3692:

For the record, this design choice has the following impact : in a cluster of 2 nodes with
a common database (using the DefaultDatabaseLocker), it means that when both nodes have at
some point lost their connection to the database, none of the 2 ActiveMQ broker nodes is not
restarted anymore and therefore all JMS routes are in error until a manual restart of the
ActiveMQ broker bundle is launched.
For our mission-critical usage of ServiceMix, this was not considered as acceptable and this
is the reason why we created the BrokerBundleWatcher.  Another (less elegant) solution would
be to write a script that monitors the broker and restarts the ActiveMQ broker in case of

> ActiveMQ OSGi bundle should be stopped when broker stops itself
> ---------------------------------------------------------------
>                 Key: AMQ-3692
>                 URL:
>             Project: ActiveMQ
>          Issue Type: New Feature
>          Components: Broker
>    Affects Versions: 5.4.2
>         Environment: ServiceMix 4.3
>            Reporter: metatech
>            Assignee: Hiram Chirino
>             Fix For: 5.9.0
>         Attachments: activemq-broker.xml, BrokerBundleWatcher.patch, BrokerBundleWatcher_v2.patch,
BrokerBundleWatcher_v3.patch, BrokerService.patch
> 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
For more information on JIRA, see:

View raw message