You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rob Godfrey (JIRA)" <ji...@apache.org> on 2015/05/20 11:41:59 UTC

[jira] [Created] (QPID-6550) [Java Broker] BrokerStoreUpgraderAndRecoverer incorrectly adds vhostaliases to non-AMQP ports which do not have protocols

Rob Godfrey created QPID-6550:
---------------------------------

             Summary: [Java Broker] BrokerStoreUpgraderAndRecoverer incorrectly adds vhostaliases to non-AMQP ports which do not have protocols
                 Key: QPID-6550
                 URL: https://issues.apache.org/jira/browse/QPID-6550
             Project: Qpid
          Issue Type: Bug
          Components: Java Broker
            Reporter: Rob Godfrey
             Fix For: 6.0 [Java]


The BrokerStoreUpgraderAndRecoverer upgrade from model version 2.0 to 3.0 has incorrect logic in identifying AMQP port configurations:

{code}
private boolean isAmqpPort(final Map<String, Object> attributes)
        {
            Object type = attributes.get(ConfiguredObject.TYPE);
            Object protocols = attributes.get(Port.PROTOCOLS);
            String protocolString = protocols == null ? null : protocols.toString();
            return "AMQP".equals(type)
                   || protocolString == null
                   || !protocolString.matches(".*\\w.*")
                   || protocolString.contains("AMQP");

        }
{code}

will incorrectly identify ports with a non-AMQP type as being AMQP ports.

This should be corrected to something like:

{code}

        private boolean isAmqpPort(final Map<String, Object> attributes)
        {
            Object type = attributes.get(ConfiguredObject.TYPE);
            Object protocols = attributes.get(Port.PROTOCOLS);
            String protocolString = protocols == null ? null : protocols.toString();
            return "AMQP".equals(type)
                   || ((type == null || "".equals(type.toString().trim()))
                       && (protocolString == null
                           || !protocolString.matches(".*\\w.*")
                           || protocolString.contains("AMQP")));

        }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org