[ 
https://issues.apache.org/jira/browse/QPID-3785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194831#comment-13194831
 ] 

Ted Ross commented on QPID-3785:
--------------------------------

The broker name "amqp-broker" needs to be a constant and needs to be the same 
on all brokers.  It is basically a well-known way to address the singleton 
broker object for management.  It is not intended to be an identifying name.

>From a larger QMFv2 perspective, the identifier of an object has two 
>components, the component name ("amqp-broker" in this case) and the agent 
>name, which is unique for every broker (or non-broker agent).  You should 
>address your uniqueness issue by using the agent-name component of the object 
>address.

This can be illustrated using qmf-tool.  After typing "query broker", typing 
"list" shows the list of objects that came back from the query:

qmf: list
Accumulated Query Results:
    Number  Agent                                                  Data Address
    
==========================================================================================================
    1       apache.org:qpidd:eb2ac99e-df2f-4c76-b77d-f8e26992e73a  
org.apache.qpid.broker:broker:amqp-broker

                
> Broker name parametrization
> ---------------------------
>
>                 Key: QPID-3785
>                 URL: https://issues.apache.org/jira/browse/QPID-3785
>             Project: Qpid
>          Issue Type: Improvement
>          Components: C++ Broker, Qpid Managment Framework
>            Reporter: Sebastiano Merlino
>            Assignee: Ted Ross
>              Labels: patch
>         Attachments: diff.patch
>
>
> In order to allow management tools (e.g. cumin, sesame) to properly work in a 
> multibroker environment without overlapping data between different brokers, 
> it would be useful to set the broker name through the use of a parameter. For 
> example, sesame generate the data identifier starting from the broker name.
> In actual implementation the broker name is always settled to "amqp-broker". 
> I have applied this patch to the code:
> {code} 
> Index: Broker.cpp
> ===================================================================
> --- Broker.cpp        (revisione 1235214)
> +++ Broker.cpp        (copia locale)
> @@ -101,6 +101,7 @@
>  
>  Broker::Options::Options(const std::string& name) :
>      qpid::Options(name),
> +     brokerName("amqp-broker"),
>      noDataDir(0),
>      port(DEFAULT_PORT),
>      workerThreads(5),
> @@ -135,6 +136,7 @@
>      dataDir += DEFAULT_DATA_DIR_NAME;
>  
>      addOptions()
> +             ("broker-name", optValue(brokerName, "STR"), "Broker name on 
> the network")
>          ("data-dir", optValue(dataDir,"DIR"), "Directory to contain 
> persistent data generated by the broker")
>          ("no-data-dir", optValue(noDataDir), "Don't use a data directory.  
> No persistent configuration will be loaded or stored")
>          ("port,p", optValue(port,"PORT"), "Tells the broker to listen on 
> PORT")
> @@ -209,7 +211,7 @@
>          System* system = new System (dataDir.isEnabled() ? dataDir.getPath() 
> : string(), this);
>          systemObject = System::shared_ptr(system);
>  
> -        mgmtObject = new _qmf::Broker(managementAgent.get(), this, system, 
> "amqp-broker");
> +        mgmtObject = new _qmf::Broker(managementAgent.get(), this, system, 
> conf.brokerName);
>          
> mgmtObject->set_systemRef(system->GetManagementObject()->getObjectId());
>          mgmtObject->set_port(conf.port);
>          mgmtObject->set_workerThreads(conf.workerThreads);
> Index: Broker.h
> ===================================================================
> --- Broker.h  (revisione 1235214)
> +++ Broker.h  (copia locale)
> @@ -96,6 +96,7 @@
>  
>          QPID_BROKER_EXTERN Options(const std::string& name="Broker Options");
>  
> +             std::string brokerName;
>          bool noDataDir;
>          std::string dataDir;
>          uint16_t port;
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to