-
Notifications
You must be signed in to change notification settings - Fork 918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARTEMIS-2565 - Add plugin support for Federated Queues/Addresses #2903
Conversation
@clebertsuconic or @michaelandrepearce - Can one of you take a look and see if it's ok to merge this? |
@cshannon was out last week, will aim to look this week for you |
@michaelandrepearce - Sounds good, thanks |
13f41a5
to
e890c6c
Compare
try { | ||
server.callBrokerFederationPlugins(plugin -> plugin.beforeFederatedQueueConsumerMessageHandled(this, clientMessage)); | ||
} catch (ActiveMQException t) { | ||
logger.warn("Error executing beforeFederatedQueueConsumerMessageHandled plugin method: {}", t.getMessage(), t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a logger with code, e.g. explicit method logger with code as at warn (same for all logger.warns in this PR)
protected void callFederationStreamStartedPlugins() { | ||
if (server.hasBrokerFederationPlugins()) { | ||
try { | ||
server.callBrokerFederationPlugins(plugin -> plugin.federationStreamStarted(this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to pass this to the plugin, we should extract interface, and method of federationStreamStarted should take the interface, not the implementation. As plugin should just have api's, else will cause issues in any future refactor (like you had done in last pr)
if (server.hasBrokerFederationPlugins()) { | ||
try { | ||
final FederatedQueueConsumer finalConsumer = remoteQueueConsumer; | ||
server.callBrokerFederationPlugins(plugin -> plugin.afterCreateFederatedQueueConsumer(finalConsumer)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should extract interface of FederationQueueConsumer, and make plugin use the interface, not concrete implementation, as this plugins will cause it to be a public api for end users, making any future refactoring impossible.
@@ -104,9 +109,27 @@ public synchronized void createRemoteConsumer(FederatedConsumerKey key, Transfor | |||
if (started) { | |||
FederatedQueueConsumer remoteQueueConsumer = remoteQueueConsumers.get(key); | |||
if (remoteQueueConsumer == null) { | |||
if (server.hasBrokerFederationPlugins()) { | |||
try { | |||
server.callBrokerFederationPlugins(plugin -> plugin.beforeCreateFederatedQueueConsumer(key)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract interface, so that plugin does not expose concrete implementation, but simply api.
@cshannon as you would have seen, two main bits to address here.
Apart from that looks good. (thumbs up) |
@michaelandrepearce - Those changes sound good to me and I can get to it either today or Monday probably. As a preview, 2 more things I'm working on:
|
@michaelandrepearce - I'm hoping to get back to this tomorrow/friday and finish it up before I am out of the office for the holidays. I had to take care of some other stuff this week that came up. |
e890c6c
to
92491e8
Compare
@michaelandrepearce - not sure if you saw or not but I updated the PR with the changes |
Sorry away on PTO. Lgtm. Feel free to merge |
Add a new interface called ActiveMQServerFederationPlugin to allow customization of the federated queue/address feature of the broker
@michaelandrepearce - sounds good, I will rebase and merge today |
Add a new interface called ActiveMQServerFederationPlugin to allow
customization of the federated queue/address feature of the broker