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 Thu, 03 Sep 2009 08:28:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=qpid&amp;forWysiwyg=true"
type="text/css">
    </head>
<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/~robbie">Robbie
Gemmell</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <h3><a name="QpidDesign-Configuration-ConfigurationMethods"></a>Configuration
Methods</h3>

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


<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>
<ul>
	<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>
</ul>


<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.apache.qpid.server.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
File</h3>

<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
Options</h3>

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

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Option</th>
<th class='confluenceTh'>Long Option</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'>b</td>
<td class='confluenceTd'>bind</td>
<td class='confluenceTd'>Bind to the specified address overriding any value in the config
file</td>
</tr>
<tr>
<td class='confluenceTd'>c</td>
<td class='confluenceTd'>config</td>
<td class='confluenceTd'>Use the given configuration file</td>
</tr>
<tr>
<td class='confluenceTd'>h</td>
<td class='confluenceTd'>help</td>
<td class='confluenceTd'>Prints list of options</td>
</tr>
<tr>
<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
directory</td>
</tr>
<tr>
<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>
</tr>
<tr>
<td class='confluenceTd'>p</td>
<td class='confluenceTd'>port</td>
<td class='confluenceTd'>Specify port to listen on. Overrides value in config file</td>
</tr>
<tr>
<td class='confluenceTd'>v</td>
<td class='confluenceTd'>version</td>
<td class='confluenceTd'>Print version information and exit</td>
</tr>
<tr>
<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>
</tr>
</tbody></table>

<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
logging:</p>
<ul>
	<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
file</li>
	<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>
</ul>


<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>
     <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>
       </div>

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

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


Mime
View raw message