[ 
https://issues.apache.org/jira/browse/ARTEMIS-2565?focusedWorklogId=359749&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-359749
 ]

ASF GitHub Bot logged work on ARTEMIS-2565:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Dec/19 03:04
            Start Date: 14/Dec/19 03:04
    Worklog Time Spent: 10m 
      Work Description: michaelandrepearce commented on pull request #2903: 
ARTEMIS-2565 - Add plugin support for Federated Queues/Addresses
URL: https://github.com/apache/activemq-artemis/pull/2903#discussion_r357893119
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/FederatedAbstract.java
 ##########
 @@ -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));
+               } catch (ActiveMQException t) {
+                  logger.warn("Error executing 
beforeCreateFederatedQueueConsumer plugin method: {}", t.getMessage(), t);
+                  throw new IllegalStateException(t.getMessage(), 
t.getCause());
+               }
+            }
             remoteQueueConsumer = new FederatedQueueConsumer(federation, 
server, transformer, key, upstream, callback);
             remoteQueueConsumer.start();
             remoteQueueConsumers.put(key, remoteQueueConsumer);
+
+            if (server.hasBrokerFederationPlugins()) {
+               try {
+                  final FederatedQueueConsumer finalConsumer = 
remoteQueueConsumer;
+                  server.callBrokerFederationPlugins(plugin -> 
plugin.afterCreateFederatedQueueConsumer(finalConsumer));
 
 Review comment:
   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.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 359749)
    Time Spent: 1h 10m  (was: 1h)

> Add plugin support for Federated Queues/Addresses
> -------------------------------------------------
>
>                 Key: ARTEMIS-2565
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2565
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 2.10.1
>            Reporter: Christopher L. Shannon
>            Assignee: Christopher L. Shannon
>            Priority: Major
>             Fix For: 2.11.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> In many cases it could be useful to have hooks for custom logic to be 
> processed when using the Federated queue/address feature.  This can be 
> implemented using the plugin API via a new interface.  This Jira is a start 
> at adding in plugin methods but more can be added to the interface in the 
> future plus we could have follow on Jiras to include some plugins (such as 
> for metrics)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to