Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-3785

Broker name parametrization

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • C++ Broker, QMF

    Description

      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:

       
      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;
      

      Attachments

        1. diff.patch
          2 kB
          Sebastiano Merlino

        Activity

          People

            tross Ted Ross
            etr Sebastiano Merlino
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: