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

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

                Author: ASF GitHub Bot
            Created on: 20/Nov/19 08:50
            Start Date: 20/Nov/19 08:50
    Worklog Time Spent: 10m 
      Work Description: michaelandrepearce commented on pull request #2892: 
ARTEMIS-2549 - Add Downstream support to Federation
URL: https://github.com/apache/activemq-artemis/pull/2892#discussion_r348353170
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/address/FederatedAddress.java
 ##########
 @@ -113,7 +116,31 @@ public void start() {
     */
    @Override
    public synchronized void afterCreateQueue(Queue queue) {
-      createRemoteConsumer(queue);
+      conditionalCreateRemoteConsumer(queue);
+   }
+
+   private void conditionalCreateRemoteConsumer(Queue queue) {
+      //Always create demand if not a federated queue
+      if (!queue.getName().toString().startsWith(FEDERATED_QUEUE_PREFIX)) {
+         createRemoteConsumer(queue);
+      } else {
+         //For federated queues we want to make sure that we aren't creating 
demand
+         //if the federated queue is part of the same federation stream as we 
would get into a situation
+         //where a local consumer on broker A created a federated queue on 
broker B and in turn broker
+         //A would respond to the federated queue on B and created a federated 
queue on A even though there is
+         //no local demand on B
+
+         //For queues part of a different federation stream we want to create 
demand
+         String[] federationToken = queue.getName().toString().split("\\.");
 
 Review comment:
   Where is the "." coming from? Is it wildcard settings separator? If so will 
need to honor that.
 
----------------------------------------------------------------
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: 346572)
    Time Spent: 1.5h  (was: 1h 20m)

> Add support for Downstream Federated Queues and Addresses
> ---------------------------------------------------------
>
>                 Key: ARTEMIS-2549
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2549
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>          Components: Broker
>    Affects Versions: 2.10.1
>            Reporter: Christopher L. Shannon
>            Assignee: Christopher L. Shannon
>            Priority: Major
>             Fix For: 2.11.0
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Currently only an upstream can be configured for federation.  For flexibility 
> we should also be able to configure downstream federated brokers.  This would 
> be especially beneficial in scenarios such as a wheel/spoke topology where 
> the central broker could have all of the upstream/downstream configurations 
> to make it easy and keep it in the same place.
> This feature piggy backs on the existing upstream framework. When a 
> downstream is configured a message is sent to the other broker on connect and 
> that remote broker will parse the message and use the information to create 
> an upstream connection back to the originating broker.  If the downstream 
> connection disconnects or is closed it will terminate the upstream 
> connection.  There will be a flag to share downstream/upstream connections to 
> the same broker. 
> The downstream configuration can be configured to use HA just like upstreams 
> so that if it terminates because the remote broker goes down it can failover 
> to another.  The resulting upstream connection that is created back to the 
> original broker that sent the downstream packet will just be a direct 
> connection back and doesn't need HA because the downstream manages it on its 
> side.
> See the documentation and examples for more info on how this will work.
>  



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

Reply via email to