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

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

                Author: ASF GitHub Bot
            Created on: 22/Oct/20 16:13
            Start Date: 22/Oct/20 16:13
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on a change in pull request 
#3294:
URL: https://github.com/apache/activemq-artemis/pull/3294#discussion_r510288296



##########
File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnectionManager.java
##########
@@ -0,0 +1,242 @@
+/**
+ * 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.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Executor;
+import java.util.concurrent.locks.Lock;
+
+import io.netty.channel.ChannelPipeline;
+import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.api.core.Interceptor;
+import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
+import 
org.apache.activemq.artemis.core.config.amqpBrokerConnectivity.AMQPBrokerConnectConfiguration;
+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.NettyConnectorFactory;
+import org.apache.activemq.artemis.core.server.ActiveMQComponent;
+import org.apache.activemq.artemis.core.server.ActiveMQServer;
+import org.apache.activemq.artemis.protocol.amqp.broker.ProtonProtocolManager;
+import 
org.apache.activemq.artemis.protocol.amqp.broker.ProtonProtocolManagerFactory;
+import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+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.spi.core.remoting.SessionContext;
+import org.apache.activemq.artemis.spi.core.remoting.TopologyResponseHandler;
+
+public class AMQPBrokerConnectionManager implements ActiveMQComponent, 
ClientConnectionLifeCycleListener {
+   private final ProtonProtocolManagerFactory protonProtocolManagerFactory;
+   private final ActiveMQServer server;
+   private volatile boolean started = false;
+
+   List<AMQPBrokerConnectConfiguration> amqpConnectionsConfig;
+   List<AMQPBrokerConnection> amqpOutgoingConnections;
+   ProtonProtocolManager protonProtocolManager;
+
+   public AMQPBrokerConnectionManager(ProtonProtocolManagerFactory factory, 
List<AMQPBrokerConnectConfiguration> amqpConnectionsConfig, ActiveMQServer 
server) {
+      this.amqpConnectionsConfig = amqpConnectionsConfig;
+      this.server = server;
+      this.protonProtocolManagerFactory = factory;
+   }
+
+   @Override
+   public void start() throws Exception {
+      if (!started) {
+         started = true;
+      }
+
+      NettyConnectorFactory factory = new 
NettyConnectorFactory().setServerConnector(true);
+      protonProtocolManager = 
(ProtonProtocolManager)protonProtocolManagerFactory.createProtocolManager(server,
 null, null, null);
+      NettyConnector bridgesConnector = 
(NettyConnector)factory.createConnector(null, null, this, 
server.getExecutorFactory().getExecutor(), server.getThreadPool(), 
server.getScheduledPool(), new 
ClientProtocolManagerWithAMQP(protonProtocolManager));
+      bridgesConnector.start();
+
+      amqpOutgoingConnections = new ArrayList<>();
+
+
+      for (AMQPBrokerConnectConfiguration config : amqpConnectionsConfig) {
+         System.out.println("Connecting " + config);

Review comment:
       I did not mean System.out... I thought I had removed it...
   
   
   I guess I did some gif-fu push -f that I lost it.. will fix it.




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


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

    Worklog Id:     (was: 503785)
    Time Spent: 17h 10m  (was: 17h)

> AMQP Server Connectivity
> ------------------------
>
>                 Key: ARTEMIS-2937
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2937
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>          Components: AMQP
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.16.0
>
>          Time Spent: 17h 10m
>  Remaining Estimate: 0h
>
> This feature adds server side connectivity.
>  
> It is possible to link two brokers directly using AMQP with this feature, and 
> have a Queue transferring messages to another broker directly. 
>  
> For this we would have options called <sender and <receiver
>  
>  
> it would also be possible to use qpid-dispatch as an intermediary between 
> clients and the brokers (or eventually between brokers), on that case the 
> option will be <peer
>  
> it would also be possible to use <mirror with a few option to replicate data 
> between two brokers, bringing the possibility of using it for Disaster & 
> Recovery and Failover.



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

Reply via email to