FUSE Message Broker
  1. FUSE Message Broker
  2. MB-818

5.4 broker always sends out peer URIs which 5.3 clients always add to failover list

    Details

    • Type: Enhancement Enhancement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: 5.4.2-fuse-00-00
    • Fix Version/s: 5.4.2-fuse-02-00
    • Component/s: None
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      So in the 5.3.1-fuse-01-00 broker we have the following start on a TransportConnection

          public void start() throws Exception {
              starting = true;
              try {
                  synchronized (this) {
                      if (taskRunnerFactory != null) {
                          taskRunner = taskRunnerFactory.createTaskRunner(this, "ActiveMQ Connection Dispatcher: "
                                  + getRemoteAddress());
                      } else {
                          taskRunner = null;
                      }
                      transport.start();
                      active = true;
                      dispatchAsync(connector.getBrokerInfo());
                      connector.onStarted(this);
                  }
              } catch (Exception e) {
                  // Force clean up on an error starting up.
                  stop();
                  throw e;
              } finally {
                  // stop() can be called from within the above block,
                  // but we want to be sure start() completes before
                  // stop() runs, so queue the stop until right now:
                  starting = false;
                  if (pendingStop) {
                      LOG.debug("Calling the delayed stop()");
                      stop();
                  }
              }
          }
      

      so it just sends out the current connected brokerUri "dispatchAsync(connector.getBrokerInfo());" However, in 5.4.2-fuse-01-00 it sends out all connected peers, whether updateClusterClients and rebalanceClusterClients are set to false or not.

          public void start() throws Exception {
              starting = true;
              try {
                  synchronized (this) {
                      if (taskRunnerFactory != null) {
                          taskRunner = taskRunnerFactory.createTaskRunner(this, "ActiveMQ Connection Dispatcher: "
                                  + getRemoteAddress());
                      } else {
                          taskRunner = null;
                      }
                      transport.start();
                      active = true;
                      BrokerInfo info = connector.getBrokerInfo().copy();
                      info.setPeerBrokerInfos(this.broker.getPeerBrokerInfos());
                      dispatchAsync(info);
                      
                      connector.onStarted(this);
                  }
              } catch (Exception e) {
                  // Force clean up on an error starting up.
                  stop();
                  throw e;
              } finally {
                  // stop() can be called from within the above block,
                  // but we want to be sure start() completes before
                  // stop() runs, so queue the stop until right now:
                  starting = false;
                  if (pendingStop) {
                      LOG.debug("Calling the delayed stop()");
                      stop();
                  }
              }
          }
      

      And the 5.3 client is set up to accept these (no possible way to disable) and add them into the failover uri list.

          TransportListener createTransportListener() {
              return new TransportListener() {
                  public void onCommand(Object o) {
                      Command command = (Command)o;
                      if (command == null) {
                          return;
                      }
                      if (command.isResponse()) {
                          Object object = null;
                          synchronized(requestMap) {
                           object = requestMap.remove(Integer.valueOf(((Response)command).getCorrelationId()));
                          }
                          if (object != null && object.getClass() == Tracked.class) {
                              ((Tracked) object).onResponses(command);
                          }
                      }
                      if (!initialized) {
                          if (command.isBrokerInfo()) {
                              BrokerInfo info = (BrokerInfo)command;
                              BrokerInfo[] peers = info.getPeerBrokerInfos();
                              if (peers != null) {
                                  for (int i = 0; i < peers.length; i++) {
                                      String brokerString = peers[i].getBrokerURL();
                                      add(brokerString);
                                  }
                              }
                              initialized = true;
                          }
      
                      }
                      if (transportListener != null) {
                          transportListener.onCommand(command);
                      }
                  }
      

      The 5.4 client has been modified to not accept these BrokerInfos unless updateURIsSupported is turned on.

      We should be able to disable sending out these peer BrokerInfos (see TransportConnection.start method) so that the newer brokers are still usable with older clients.

        Activity

        Hide
        Gary Tully
        added a comment -

        linking to apache issue, now resolved.

        Show
        Gary Tully
        added a comment - linking to apache issue, now resolved.
        Hide
        Gary Tully
        added a comment -

        fix merged to 5.4-fusesource branch.

        Show
        Gary Tully
        added a comment - fix merged to 5.4-fusesource branch.

          People

          • Assignee:
            Gary Tully
            Reporter:
            Jonathan Anstey
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: