Skip to content

Conversation

@AntonRoskvist
Copy link
Contributor

Added afterStart and beforeStopped methods to ServerBasePlugin. This adds a convenient way of tying plugin lifecycle to the brokers and simplify clean start and stop of whatever the plugin does.

@jbertram
Copy link
Contributor

jbertram commented Dec 9, 2025

I think you can do essentially the same thing already using an implementation of org.apache.activemq.artemis.core.server.ActivateCallback. You can see in the code that the callback is invoked right around the same time your new methods are.

To be clear, o.a.a.a.c.s.ActivateCallback#preDeActivate is equivalent to o.a.a.a.c.s.plugin.ActiveMQServerBasePlugin#beforeStopped and o.a.a.a.c.s.ActivateCallback#activationComplete is equivalent to o.a.a.a.c.s.plugin.ActiveMQServerBasePlugin#afterStarted.

@AntonRoskvist
Copy link
Contributor Author

@jbertram Wow, don't know how I missed that. The ActivateCallback works perfectly. Thanks!

I'll go ahead and close this.

@AntonRoskvist
Copy link
Contributor Author

Not needed, ActivateCallback already does this.

@AntonRoskvist AntonRoskvist deleted the pluginBrokerLifecycle branch December 10, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants