4 Replies Latest reply on Nov 28, 2012 10:59 AM by komododave

    What variables/properties can we reference in configuration files?

    komododave

      I routinely see reference to variables/properties when viewing configuration files.

       

      For example, after creating an MQ broker, the broker.xml contains reference to *${broker-name}* and *$*. I've tried to find the definition for *${broker-name}*, first by running *config:list | grep 'broker-name'* in the ESB command console and then by seeking within my root ensemble node via *find . | xargs -n 1 grep 'broker-name'*. Neither method retrieved anything.

       

      Near the top of the broker.xml definition is a comment:

       

      *<!-- Allows us to use system properties and fabric as variables in this configuration file -->*

       

      Where are these 'fabric' variables listed?

       

      Another example can be seen in the default profile. Running profile-display default displays the configuration property:

       

      PID: org.fusesource.fabric.zookeeper

          zookeeper.url $:2181

       

      Where is this $ defined? It looks like a command from the feature fabric-zookeeper-commands, yet I don't have that installed.

       

      I read  this page which indicates such properties are in the configuration (meaning 'configuration registry'?). In which case why does config:list run on a lone root ensemble node not display them?

       

      It states here that "the fabric properties for a broker are specified using the PID org.fusesource.mq.fabric.server-profileName, so to specify a value for the broker-name property for the profile called myBroker you would...". I have tried running:

       

      FuseFabric:admin@root> config:list '(service.pid=org.fusesource.mq.fabric.server-mq)'

      FuseFabric:admin@root> config:list '(pid=org.fusesource.mq.fabric.server-mq)'

       

      Neither works to display the broker-name property of the mq profile.

       

      It would be good to know:

       

      1. Where in the filesystem and/or fabric these properties are defined, what their scope is and what is the proper term for them.

       

      2. How to display a complete list of those available.

       

      3. Where they can be referenced - e.g. "only in configuration files, be that .xml or .properties"

       

      4. Whether custom ones can be defined.

       

      Sincere thanks.

        • 1. Re: What variables/properties can we reference in configuration files?
          stlewis

          These are effectively OSGi blueprint substitutions.  MQ is configured as a managed service factory, meaning that the base configuration can be shared by broker instances in a container, with specific stuff configured via a properties file.  When using fabric this properties file is in a profile.  For the mq-base/mq setup out of the box the file you'd want to look at is in the "mq" profile, in FMC go to the Configurations tab for that profile and look at the "org.fusesource.mq.fabric.server-broker.properties" configuration.

          • 2. Re: What variables/properties can we reference in configuration files?
            komododave

            Thank you for this information Stan.

             

            It concerns me when an explanation begins with "effectively..", purely because it feels like a 6th grade explanation instead of how things really are! Are you implying it's logic in Fabric which performs OSGi blueprint substitutions as well as some other things?

             

            I had a look in the mq configuration properties you pointed me to. So why is it that broker-name isn't defined in there? Is there a way for me to learn all available properties not yet specified in there besides digging through source code?

            • 3. Re: What variables/properties can we reference in configuration files?
              stlewis

              Actually I think it is a blueprint config, I haven't worked on that particular component so I'm less familiar with it, the MQ forum might be a better place to ask for details.

               

              Anyway unfortunately blueprint doesn't offer a way to introspect what possible configuration settings are available to be set, at least that I'm aware of.  You can set the broker name via that configuration file, but if it's not set then MQ will use the Karaf container name, hence why it's not in the configuration file.

              • 4. Re: What variables/properties can we reference in configuration files?
                komododave

                Ok sure thing. Thank you for clarifying Stan, much appreciated.