qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Qpid > Qpid Design - Configuration
Date Wed, 02 Sep 2009 15:59:00 GMT
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=qpid&amp;forWysiwyg=true"
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/qpid/Qpid+Design+-+Configuration">Qpid
Design - Configuration</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~aidan">Aidan
     <div class="notificationGreySide">
         <h3><a name="QpidDesign-Configuration-ConfigurationMethods"></a>Configuration

<p>QPID&nbsp;supports two methods of configuration:</p>
	<li>command line switches (e.g. passing a &#45;p flag on startup to specify the
	<li>configuration file</li>

<p>It is intended that the configuration file will be used for nearly all configuration
but that some very common or useful options are exposed using command line switches.</p>

<h3><a name="QpidDesign-Configuration-CLI"></a>CLI</h3>

<p>QPID&nbsp;uses <a href="http://jakarta.apache.org/commons/cli" rel="nofollow">Commons
CLI</a> to parse command line arguments. It provides the following features:</p>
	<li>Ability to parse both short and long flags (e.g. &#45;p and &#45;-port)
and treat them as the same logical option</li>
	<li>Generation of well formatted usage messages</li>
	<li>Ability to specify configuration options in different ways, such as from files
or from system properties, which can help when writing unit tests</li>

<p>The result of parsing options, however they are specified, is a CommandLine object
which can then be queried to find out specific values. Currently this is done in org.openamq.broker.Main
and the CommandLine object is not exposed elsewhere but if it does require to be more widely
used it could be added to the ApplicationRegistry. However it is strongly recommended that
the configuration approach in the follow section is used where possible.</p>

<h3><a name="QpidDesign-Configuration-ConfigurationFile"></a>Configuration

<p>QPID&nbsp;uses <a href="http://jakarta.apache.org/commons/configuration" rel="nofollow">Commons
Configuration</a> to handle all configuration. It provides methods that allow parsing
of options from a range of sources, including configuration files, system properties or simply
hard coded classes of values (which is very useful in unit test cases).</p>

<p>Broker configuration is accessed through the class in the org.apache.qpid.server.configuration,
primarily starting at ServerConfiguration and retrieving values or other Configuration classes
from there. </p>

<h3><a name="QpidDesign-Configuration-CommandLineOptions"></a>Command Line

<p>The following options are available:</p>

<table class='confluenceTable'><tbody>
<th class='confluenceTh'>Option</th>
<th class='confluenceTh'>Long Option</th>
<th class='confluenceTh'>Description</th>
<td class='confluenceTd'>b</td>
<td class='confluenceTd'>bind</td>
<td class='confluenceTd'>Bind to the specified address overriding any value in the config
<td class='confluenceTd'>c</td>
<td class='confluenceTd'>config</td>
<td class='confluenceTd'>Use the given configuration file</td>
<td class='confluenceTd'>h</td>
<td class='confluenceTd'>help</td>
<td class='confluenceTd'>Prints list of options</td>
<td class='confluenceTd'>l</td>
<td class='confluenceTd'>logconfig</td>
<td class='confluenceTd'>Use the specified log4j.xml file rather than that in the etc
<td class='confluenceTd'>m</td>
<td class='confluenceTd'>mport</td>
<td class='confluenceTd'>Specify port to listen on for the JMX Management. Overrides
value in config file</td>
<td class='confluenceTd'>p</td>
<td class='confluenceTd'>port</td>
<td class='confluenceTd'>Specify port to listen on. Overrides value in config file</td>
<td class='confluenceTd'>v</td>
<td class='confluenceTd'>version</td>
<td class='confluenceTd'>Print version information and exit</td>
<td class='confluenceTd'>w</td>
<td class='confluenceTd'>logwatch</td>
<td class='confluenceTd'>Specify interval for checking for logging config changes. Zero
means no checking</td>

<h3><a name="QpidDesign-Configuration-Logging"></a>Logging</h3>

<p>Logging is handled slightly differently. The main reason for this is that logging
is something we want configured before the main configuration file is processed.</p>

<p>The broker uses log4j as the logging implementation, and configuration must be done
using the more expressive XML format. A couple of command line switches are used to configure
	<li>&#45;l, &#45;-logconfig specifies the log configuration file to use. By
default it looks for a file called log4j.xml located in the same directory as the config.xml
	<li>&#45;w, &#45;-logwatch the interval in seconds to poll the log configuration
file for changes. The default is 60 seconds and zero means do not poll for changes.</li>

<p>By using the logwatch option it is possible to make changes to the logging configuration
at runtime without restarting the broker. (For example, enabling more logging on certain packages
in order to diagnose a problem).</p>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>

       <a href="http://cwiki.apache.org/confluence/display/qpid/Qpid+Design+-+Configuration">View
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=28375&revisedVersion=3&originalVersion=2">View
       <a href="http://cwiki.apache.org/confluence/display/qpid/Qpid+Design+-+Configuration?showComments=true&amp;showCommentArea=true#addcomment">Add

Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org

View raw message