code: @Override
      public Connection getConnection(RpcClient rpcClient, ClientTransportConfig transportConfig, Url url) {
          if (rpcClient == null || transportConfig == null || url == null) {
              return null;
          }
          Connection connection = urlConnectionMap.get(transportConfig);
          if (connection != null && !connection.isFine()) {
              closeConnection(rpcClient, transportConfig, url);
              connection = null;
          }
          if (connection == null) {
              try {
                  connection = rpcClient.getConnection(url, url.getConnectTimeout());
              } catch (Exception e) {
                  LOGGER.warn("get connection failed in url," + url);
              }
              if (connection == null) {
                  return null;
              }
              // 保存唯一长连接
              Connection oldConnection = urlConnectionMap.putIfAbsent(transportConfig, connection);
              if (oldConnection != null) {
                  if (LOGGER.isWarnEnabled()) {
                      LOGGER.warn("Multiple threads init ClientTransport with same key:" + url);
                  }
                  //only if new connection is not equals old connection,we can close it
                  if (connection != oldConnection) {
                      rpcClient.closeStandaloneConnection(connection); //如果同时有人插入，则使用第一个
                      connection = oldConnection;
                  }
              } else {
  
                  // 增加计数器
                  AtomicInteger counter = connectionRefCounter.get(connection);
                  if (counter == null) {
                      counter = new AtomicInteger(0);
                      AtomicInteger oldCounter = connectionRefCounter.putIfAbsent(connection, counter);
                      if (oldCounter != null) {
                          counter = oldCounter;
                      }
                  }
                  int currentCount = counter.incrementAndGet();
                  if (LOGGER.isDebugEnabled()) {
                      LOGGER.debug("Bolt client transport {} of {}, current ref count is: {}", url.toString(),
                          NetUtils.channelToString(connection.getLocalAddress(), connection.getRemoteAddress()),
                          currentCount);
                  }
              }
          }
          return connection;
      }
docs: 通过配置获取长连接
  
  @param rpcClient       bolt客户端
  @param transportConfig 传输层配置
  @param url             传输层地址
  @return 长连接