You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/10/24 12:32:36 UTC

[GitHub] [activemq-artemis] franz1981 commented on a change in pull request #3294: ARTEMIS-2937 Server Side AMQP Connectivity with options to transfer queue or replicate data

franz1981 commented on a change in pull request #3294:
URL: https://github.com/apache/activemq-artemis/pull/3294#discussion_r511423156



##########
File path: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ByteUtil.java
##########
@@ -53,19 +53,27 @@
 
    public static void debugFrame(Logger logger, String message, ByteBuf byteIn) {
       if (logger.isTraceEnabled()) {
-         int location = byteIn.readerIndex();
-         // debugging
-         byte[] frame = new byte[byteIn.writerIndex()];
-         byteIn.readBytes(frame);
+         outFrame(logger, message, byteIn, false);
+      }
+   }
 
-         try {
+   public static void outFrame(Logger logger, String message, ByteBuf byteIn, boolean info) {
+      int location = byteIn.readerIndex();
+      // debugging

Review comment:
       This can became a proper debug/trace info

##########
File path: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListImpl.java
##########
@@ -46,13 +49,59 @@
 
    private final Comparator<E> comparator;
 
+   private ToLongFunction<E> idSupplier;
+
+   LongObjectHashMap<Node<E>> nodeMap;
+
    public LinkedListImpl() {
-      this(null);
+      this(null, null);
    }
 
+
    public LinkedListImpl(Comparator<E> comparator) {
+      this(comparator, null);
+   }
+
+   @Override
+   public void clearID() {
+      idSupplier = null;
+      nodeMap.clear(); // just a little hand to GC

Review comment:
       ```suggestion
         if (nodeMap != null) {
             nodeMap.clear();
             nodeMap = null;
         }
   ```

##########
File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnection.java
##########
@@ -0,0 +1,540 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.protocol.amqp.connect;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+
+import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.api.core.QueueConfiguration;
+import org.apache.activemq.artemis.api.core.RoutingType;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPBrokerConnectConfiguration;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPBrokerConnectionElement;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPBrokerConnectionAddressType;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPMirrorBrokerConnectionElement;
+import org.apache.activemq.artemis.core.postoffice.Binding;
+import org.apache.activemq.artemis.core.postoffice.QueueBinding;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnection;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector;
+import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
+import org.apache.activemq.artemis.core.server.ActiveMQComponent;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.Consumer;
+import org.apache.activemq.artemis.core.server.Queue;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
+import org.apache.activemq.artemis.core.server.plugin.ActiveMQServerQueuePlugin;
+import org.apache.activemq.artemis.core.server.mirror.MirrorController;
+import org.apache.activemq.artemis.protocol.amqp.broker.AMQPSessionCallback;
+import org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection;
+import org.apache.activemq.artemis.protocol.amqp.broker.ProtonProtocolManager;
+import org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerAggregation;
+import org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerSource;
+import org.apache.activemq.artemis.protocol.amqp.logger.ActiveMQAMQPProtocolLogger;
+import org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext;
+import org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext;
+import org.apache.activemq.artemis.protocol.amqp.proton.SenderController;
+import org.apache.activemq.artemis.protocol.amqp.sasl.ClientSASL;
+import org.apache.activemq.artemis.protocol.amqp.sasl.ClientSASLFactory;
+import org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry;
+import org.apache.activemq.artemis.spi.core.remoting.ClientConnectionLifeCycleListener;
+import org.apache.activemq.artemis.spi.core.remoting.ClientProtocolManager;
+import org.apache.activemq.artemis.spi.core.remoting.Connection;
+import org.apache.activemq.artemis.utils.ConfigurationHelper;
+import org.apache.activemq.artemis.utils.UUIDGenerator;
+import org.apache.qpid.proton.amqp.Symbol;
+import org.apache.qpid.proton.amqp.messaging.Source;
+import org.apache.qpid.proton.amqp.messaging.Target;
+import org.apache.qpid.proton.engine.Receiver;
+import org.apache.qpid.proton.engine.Sender;
+import org.apache.qpid.proton.engine.Session;
+import org.jboss.logging.Logger;
+
+public class AMQPBrokerConnection implements ClientConnectionLifeCycleListener, ActiveMQServerQueuePlugin {
+
+   private static final Logger logger = Logger.getLogger(AMQPBrokerConnection.class);
+
+   private final AMQPBrokerConnectConfiguration amqpConfiguration;
+   private final ProtonProtocolManager protonProtocolManager;
+   private final ActiveMQServer server;
+   private final NettyConnector bridgesConnector;
+   private NettyConnection connection;
+   private Session session;
+   AMQPSessionContext sessionContext;
+   ActiveMQProtonRemotingConnection protonRemotingConnection;
+   private volatile boolean started = false;
+   private final AMQPBrokerConnectionManager bridgeManager;
+   private int retryCounter = 0;
+   private volatile ScheduledFuture reconnectFuture;
+   Map<Queue, Sender> senders = new HashMap<>();
+   Map<Queue, Receiver> receivers = new HashMap<>();
+
+   final Executor connectExecutor;
+   final ScheduledExecutorService scheduledExecutorService;
+
+   /** This is just for logging.
+    *  the actual connection will come from the amqpConnection configuration*/
+   String host;
+
+   /** This is just for logging.
+    *  the actual connection will come from the amqpConnection configuration*/
+   int port;
+
+   public AMQPBrokerConnection(AMQPBrokerConnectionManager bridgeManager, AMQPBrokerConnectConfiguration amqpConfiguration,
+                               ProtonProtocolManager protonProtocolManager,
+                               ActiveMQServer server,
+                               NettyConnector bridgesConnector) {
+      this.bridgeManager = bridgeManager;
+      this.amqpConfiguration = amqpConfiguration;
+      this.protonProtocolManager = protonProtocolManager;
+      this.server = server;
+      this.bridgesConnector = bridgesConnector;
+      connectExecutor = server.getExecutorFactory().getExecutor();
+      scheduledExecutorService = server.getScheduledPool();
+   }
+
+   public void stop() {
+      if (connection != null) {
+         connection.close();
+      }
+      ScheduledFuture scheduledFuture = reconnectFuture;
+      reconnectFuture = null;
+      if (scheduledFuture != null) {
+         scheduledFuture.cancel(true);
+      }
+      started = false;

Review comment:
       I see that `started` is volatile but `stop`/`connect` are meant to be called by different threads? 
   I would at least guard with single threaded code checks from being started or stopped twice

##########
File path: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListImpl.java
##########
@@ -46,13 +49,59 @@
 
    private final Comparator<E> comparator;
 
+   private ToLongFunction<E> idSupplier;
+
+   LongObjectHashMap<Node<E>> nodeMap;
+
    public LinkedListImpl() {
-      this(null);
+      this(null, null);
    }
 
+
    public LinkedListImpl(Comparator<E> comparator) {
+      this(comparator, null);
+   }
+
+   @Override
+   public void clearID() {
+      idSupplier = null;
+      nodeMap.clear(); // just a little hand to GC
+      nodeMap = null;
+   }
+
+   @Override
+   public void setIDSupplier(ToLongFunction<E> supplier) {
+      this.idSupplier = supplier;
+      nodeMap = new LongObjectHashMap<>(this.size);
+
+      Iterator iterator = (Iterator)iterator();

Review comment:
       Iterator is `AutoCloseable`? If not, make it `AutoCloseable` and use try-with-resources eg
   ```java 
   try (Itereator iterator = (Iterator) interator) {
   ```

##########
File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageBrokerAccessor.java
##########
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.protocol.amqp.broker;
+
+import org.apache.qpid.proton.amqp.Symbol;
+import org.apache.qpid.proton.amqp.messaging.Header;
+
+/** <b>Warning:</b> do not use this class outside of the broker implementation.
+ *  This is exposing package methods on this package that are not meant to be used on user's appliation. */

Review comment:
       appliation -> application

##########
File path: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListImpl.java
##########
@@ -46,13 +49,59 @@
 
    private final Comparator<E> comparator;
 
+   private ToLongFunction<E> idSupplier;
+
+   LongObjectHashMap<Node<E>> nodeMap;
+
    public LinkedListImpl() {
-      this(null);
+      this(null, null);
    }
 
+
    public LinkedListImpl(Comparator<E> comparator) {
+      this(comparator, null);
+   }
+
+   @Override
+   public void clearID() {
+      idSupplier = null;
+      nodeMap.clear(); // just a little hand to GC
+      nodeMap = null;
+   }
+
+   @Override
+   public void setIDSupplier(ToLongFunction<E> supplier) {
+      this.idSupplier = supplier;
+      nodeMap = new LongObjectHashMap<>(this.size);
+
+      Iterator iterator = (Iterator)iterator();
+      try {
+         while (iterator.hasNext()) {
+            E value = iterator.next();
+            Node<E> position = iterator.last;
+            putID(value, position);
+         }
+      } finally {
+         iterator.close();
+      }
+   }
+
+   private void putID(E value, Node<E> position) {
+      long id = idSupplier.applyAsLong(value);
+      if (id >= 0) {
+         nodeMap.put(id, position);
+      }
+   }
+
+   public LinkedListImpl(Comparator<E> comparator, ToLongFunction<E> supplier) {
       iters = createIteratorArray(INITIAL_ITERATOR_ARRAY_SIZE);
       this.comparator = comparator;
+      this.idSupplier = supplier;
+      if (idSupplier != null) {
+         this.nodeMap = new LongObjectHashMap<>(this.size);

Review comment:
       `this.size is 0` here 

##########
File path: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/LinkedListImpl.java
##########
@@ -46,13 +49,59 @@
 
    private final Comparator<E> comparator;
 
+   private ToLongFunction<E> idSupplier;
+
+   LongObjectHashMap<Node<E>> nodeMap;
+
    public LinkedListImpl() {
-      this(null);
+      this(null, null);
    }
 
+
    public LinkedListImpl(Comparator<E> comparator) {
+      this(comparator, null);
+   }
+
+   @Override
+   public void clearID() {
+      idSupplier = null;
+      nodeMap.clear(); // just a little hand to GC
+      nodeMap = null;
+   }
+
+   @Override
+   public void setIDSupplier(ToLongFunction<E> supplier) {
+      this.idSupplier = supplier;
+      nodeMap = new LongObjectHashMap<>(this.size);

Review comment:
       What happen to any previously set `idSupplier`/`nodeMap`?
   Better to `throw new IllegalStateException("cannot set an ID supplier twice")` to save it to happen

##########
File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnection.java
##########
@@ -0,0 +1,540 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.protocol.amqp.connect;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+
+import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.api.core.QueueConfiguration;
+import org.apache.activemq.artemis.api.core.RoutingType;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPBrokerConnectConfiguration;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPBrokerConnectionElement;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPBrokerConnectionAddressType;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPMirrorBrokerConnectionElement;
+import org.apache.activemq.artemis.core.postoffice.Binding;
+import org.apache.activemq.artemis.core.postoffice.QueueBinding;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnection;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector;
+import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
+import org.apache.activemq.artemis.core.server.ActiveMQComponent;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.Consumer;
+import org.apache.activemq.artemis.core.server.Queue;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
+import org.apache.activemq.artemis.core.server.plugin.ActiveMQServerQueuePlugin;
+import org.apache.activemq.artemis.core.server.mirror.MirrorController;
+import org.apache.activemq.artemis.protocol.amqp.broker.AMQPSessionCallback;
+import org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection;
+import org.apache.activemq.artemis.protocol.amqp.broker.ProtonProtocolManager;
+import org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerAggregation;
+import org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerSource;
+import org.apache.activemq.artemis.protocol.amqp.logger.ActiveMQAMQPProtocolLogger;
+import org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext;
+import org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext;
+import org.apache.activemq.artemis.protocol.amqp.proton.SenderController;
+import org.apache.activemq.artemis.protocol.amqp.sasl.ClientSASL;
+import org.apache.activemq.artemis.protocol.amqp.sasl.ClientSASLFactory;
+import org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry;
+import org.apache.activemq.artemis.spi.core.remoting.ClientConnectionLifeCycleListener;
+import org.apache.activemq.artemis.spi.core.remoting.ClientProtocolManager;
+import org.apache.activemq.artemis.spi.core.remoting.Connection;
+import org.apache.activemq.artemis.utils.ConfigurationHelper;
+import org.apache.activemq.artemis.utils.UUIDGenerator;
+import org.apache.qpid.proton.amqp.Symbol;
+import org.apache.qpid.proton.amqp.messaging.Source;
+import org.apache.qpid.proton.amqp.messaging.Target;
+import org.apache.qpid.proton.engine.Receiver;
+import org.apache.qpid.proton.engine.Sender;
+import org.apache.qpid.proton.engine.Session;
+import org.jboss.logging.Logger;
+
+public class AMQPBrokerConnection implements ClientConnectionLifeCycleListener, ActiveMQServerQueuePlugin {
+
+   private static final Logger logger = Logger.getLogger(AMQPBrokerConnection.class);
+
+   private final AMQPBrokerConnectConfiguration amqpConfiguration;
+   private final ProtonProtocolManager protonProtocolManager;
+   private final ActiveMQServer server;
+   private final NettyConnector bridgesConnector;
+   private NettyConnection connection;
+   private Session session;
+   AMQPSessionContext sessionContext;

Review comment:
       package private? can be private?
   Same for the others below

##########
File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnection.java
##########
@@ -0,0 +1,540 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.protocol.amqp.connect;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+
+import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.api.core.QueueConfiguration;
+import org.apache.activemq.artemis.api.core.RoutingType;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPBrokerConnectConfiguration;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPBrokerConnectionElement;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPBrokerConnectionAddressType;
+import org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPMirrorBrokerConnectionElement;
+import org.apache.activemq.artemis.core.postoffice.Binding;
+import org.apache.activemq.artemis.core.postoffice.QueueBinding;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnection;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector;
+import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants;
+import org.apache.activemq.artemis.core.server.ActiveMQComponent;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.core.server.Consumer;
+import org.apache.activemq.artemis.core.server.Queue;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
+import org.apache.activemq.artemis.core.server.plugin.ActiveMQServerQueuePlugin;
+import org.apache.activemq.artemis.core.server.mirror.MirrorController;
+import org.apache.activemq.artemis.protocol.amqp.broker.AMQPSessionCallback;
+import org.apache.activemq.artemis.protocol.amqp.broker.ActiveMQProtonRemotingConnection;
+import org.apache.activemq.artemis.protocol.amqp.broker.ProtonProtocolManager;
+import org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerAggregation;
+import org.apache.activemq.artemis.protocol.amqp.connect.mirror.AMQPMirrorControllerSource;
+import org.apache.activemq.artemis.protocol.amqp.logger.ActiveMQAMQPProtocolLogger;
+import org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext;
+import org.apache.activemq.artemis.protocol.amqp.proton.ProtonServerSenderContext;
+import org.apache.activemq.artemis.protocol.amqp.proton.SenderController;
+import org.apache.activemq.artemis.protocol.amqp.sasl.ClientSASL;
+import org.apache.activemq.artemis.protocol.amqp.sasl.ClientSASLFactory;
+import org.apache.activemq.artemis.spi.core.protocol.ConnectionEntry;
+import org.apache.activemq.artemis.spi.core.remoting.ClientConnectionLifeCycleListener;
+import org.apache.activemq.artemis.spi.core.remoting.ClientProtocolManager;
+import org.apache.activemq.artemis.spi.core.remoting.Connection;
+import org.apache.activemq.artemis.utils.ConfigurationHelper;
+import org.apache.activemq.artemis.utils.UUIDGenerator;
+import org.apache.qpid.proton.amqp.Symbol;
+import org.apache.qpid.proton.amqp.messaging.Source;
+import org.apache.qpid.proton.amqp.messaging.Target;
+import org.apache.qpid.proton.engine.Receiver;
+import org.apache.qpid.proton.engine.Sender;
+import org.apache.qpid.proton.engine.Session;
+import org.jboss.logging.Logger;
+
+public class AMQPBrokerConnection implements ClientConnectionLifeCycleListener, ActiveMQServerQueuePlugin {
+
+   private static final Logger logger = Logger.getLogger(AMQPBrokerConnection.class);
+
+   private final AMQPBrokerConnectConfiguration amqpConfiguration;
+   private final ProtonProtocolManager protonProtocolManager;
+   private final ActiveMQServer server;
+   private final NettyConnector bridgesConnector;
+   private NettyConnection connection;
+   private Session session;
+   AMQPSessionContext sessionContext;
+   ActiveMQProtonRemotingConnection protonRemotingConnection;
+   private volatile boolean started = false;
+   private final AMQPBrokerConnectionManager bridgeManager;
+   private int retryCounter = 0;
+   private volatile ScheduledFuture reconnectFuture;
+   Map<Queue, Sender> senders = new HashMap<>();

Review comment:
       Not important and optional: we're lucky that `Queue` obey reference equality so you can use the `IdentityHashMap` that has a nicer footprint and performance then `HashMap`




----------------------------------------------------------------
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:
users@infra.apache.org