Effective October 27, 2012, online and email support for FuseSource products will move to Red Hat support channels. For more information, please see the JIRA Migration to Red Hat FAQ.
As of October 27th, please open all new issues in the Red Hat Customer Portal .
Issue Details (XML | Word | Printable)

Key: MB-818
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Gary Tully
Reporter: Jonathan Anstey
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
FUSE Message Broker

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

Created: 04/Feb/11 04:05 PM   Updated: 17/Feb/11 12:04 PM
Component/s: None
Affects Version/s: 5.4.2-fuse-00-00
Fix Version/s: 5.4.2-fuse-02-00

External Issue URL: https://issues.apache.org/jira/browse/AMQ-3178


 Description  « Hide
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.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Gary Tully added a comment - 11/Feb/11 05:01 PM
linking to apache issue, now resolved.

Gary Tully added a comment - 17/Feb/11 12:04 PM
fix merged to 5.4-fusesource branch.