| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <meta name="generator" content="Asciidoctor 2.0.18"> |
| <link rel="icon" type="image/png" href="images/favicon.png"> |
| <title>Using the Server</title> |
| <link rel="stylesheet" href="css/asciidoctor.css"> |
| <link rel="stylesheet" href="css/font-awesome.css"> |
| <link rel="stylesheet" href="css/rouge-github.css"> |
| </head> |
| <body class="book toc2 toc-left"> |
| <div id="header"> |
| <h1>Using the Server</h1> |
| <div id="toc" class="toc2"> |
| <div id="toctitle"><a href="index.html">User Manual for 2.31.2</a></div> |
| <ul class="sectlevel1"> |
| <li><a href="#installation">1. Installation</a></li> |
| <li><a href="#creating-a-broker-instance">2. Creating a Broker Instance</a> |
| <ul class="sectlevel2"> |
| <li><a href="#options">2.1. Options</a></li> |
| </ul> |
| </li> |
| <li><a href="#starting-and-stopping-a-broker-instance">3. Starting and Stopping a Broker Instance</a></li> |
| <li><a href="#configuration-files">4. Configuration Files</a> |
| <ul class="sectlevel2"> |
| <li><a href="#bootstrap-configuration-file">4.1. Bootstrap Configuration File</a></li> |
| <li><a href="#broker-configuration-file">4.2. Broker configuration file</a></li> |
| </ul> |
| </li> |
| <li><a href="#other-use-cases">5. Other Use-Cases</a> |
| <ul class="sectlevel2"> |
| <li><a href="#system-property-substitution">5.1. System Property Substitution</a></li> |
| <li><a href="#windows-server">5.2. Windows Server</a></li> |
| <li><a href="#adding-bootstrap-dependencies">5.3. Adding Bootstrap Dependencies</a></li> |
| <li><a href="#adding-runtime-dependencies">5.4. Adding Runtime Dependencies</a></li> |
| <li><a href="#library-path">5.5. Library Path</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <div id="content"> |
| <div id="preamble"> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>This chapter will familiarise you with how to use the Apache ActiveMQ Artemis server.</p> |
| </div> |
| <div class="paragraph"> |
| <p>We’ll show where it is, how to start and stop it, and we’ll describe the directory layout and what all the files are and what they do.</p> |
| </div> |
| <div class="paragraph"> |
| <p>This document will refer to the full path of the directory where the ActiveMQ distribution has been extracted to as <code>${ARTEMIS_HOME}</code>.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="installation"><a class="anchor" href="#installation"></a><a class="link" href="#installation">1. Installation</a></h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>You can get the latest release from the <a href="https://activemq.apache.org/components/artemis/download/">Download</a> page.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The following highlights some important folders on the distribution:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="nowrap">|___ bin |
| | |
| |___ examples |
| | |___ common |
| | |___ features |
| | |___ perf |
| | |___ protocols |
| | |
| |___ lib |
| | |___ client |
| | |
| |___ schema |
| | |
| |___ web</pre> |
| </div> |
| </div> |
| <div class="dlist"> |
| <dl> |
| <dt class="hdlist1">bin</dt> |
| <dd> |
| <p>binaries and scripts needed to run ActiveMQ Artemis.</p> |
| </dd> |
| <dt class="hdlist1">examples</dt> |
| <dd> |
| <p>All manner of examples. |
| Please refer to the <a href="examples.html#examples">examples</a> chapter for details on how to run them.</p> |
| </dd> |
| <dt class="hdlist1">lib</dt> |
| <dd> |
| <p>jars and libraries needed to run ActiveMQ Artemis</p> |
| </dd> |
| <dt class="hdlist1">schema</dt> |
| <dd> |
| <p>XML Schemas used to validate ActiveMQ Artemis configuration files</p> |
| </dd> |
| <dt class="hdlist1">web</dt> |
| <dd> |
| <p>The folder where the web context is loaded when the broker runs.</p> |
| </dd> |
| </dl> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="creating-a-broker-instance"><a class="anchor" href="#creating-a-broker-instance"></a><a class="link" href="#creating-a-broker-instance">2. Creating a Broker Instance</a></h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>A broker <em>instance</em> is the directory containing all the configuration and runtime data, such as logs and message journal, associated with a broker process. |
| It is recommended that you do <em>not</em> create the instance directory under <code>${ARTEMIS_HOME}</code>. |
| This separation is encouraged so that you can more easily upgrade when the next version of ActiveMQ Artemis is released.</p> |
| </div> |
| <div class="paragraph"> |
| <p>On Unix systems, it is a common convention to store this kind of runtime data under the <code>/var/lib</code> directory. |
| For example, to create an instance at <code>/var/lib/mybroker</code>, run the following commands in your command line shell:</p> |
| </div> |
| <div class="paragraph"> |
| <p>Before the broker is used, a broker instance must be created. |
| This process requires the use of the <a href="using-cli.html#command-line-interface">Command Line Interface</a> which is better explained in its own chapter.</p> |
| </div> |
| <div class="paragraph"> |
| <p>In the following example a broker instance named <code>mybroker</code> will be created:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span><span class="nb">cd</span> /var/lib |
| <span class="gp">$</span><span class="w"> </span><span class="k">${</span><span class="nv">ARTEMIS_HOME</span><span class="k">}</span>/bin/artemis create mybroker</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>A broker instance directory will contain the following sub directories:</p> |
| </div> |
| <div class="dlist"> |
| <dl> |
| <dt class="hdlist1">bin</dt> |
| <dd> |
| <p>holds execution scripts associated with this instance.</p> |
| </dd> |
| <dt class="hdlist1">data</dt> |
| <dd> |
| <p>holds the data files used for storing persistent messages</p> |
| </dd> |
| <dt class="hdlist1">etc</dt> |
| <dd> |
| <p>hold the instance configuration files</p> |
| </dd> |
| <dt class="hdlist1">lib</dt> |
| <dd> |
| <p>holds any custom runtime Java dependencies like transformers, plugins, interceptors, etc.</p> |
| </dd> |
| <dt class="hdlist1">log</dt> |
| <dd> |
| <p>holds rotating log files</p> |
| </dd> |
| <dt class="hdlist1">tmp</dt> |
| <dd> |
| <p>holds temporary files that are safe to delete between broker runs</p> |
| </dd> |
| </dl> |
| </div> |
| <div class="paragraph"> |
| <p>At this point you may want to adjust the default configuration located in the <code>etc</code> directory.</p> |
| </div> |
| <div class="sect2"> |
| <h3 id="options"><a class="anchor" href="#options"></a><a class="link" href="#options">2.1. Options</a></h3> |
| <div class="paragraph"> |
| <p>There are several options you can use when creating an instance. |
| For a full list of options use the <code>help</code> command:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="nowrap">$ ./artemis help create |
| NAME |
| artemis create - creates a new broker instance |
| |
| SYNOPSIS |
| artemis create [--addresses <addresses>] [--aio] [--allow-anonymous] |
| [--autocreate] [--blocking] [--cluster-password <clusterPassword>] |
| [--cluster-user <clusterUser>] [--clustered] [--data <data>] |
| [--default-port <defaultPort>] [--disable-persistence] |
| [--encoding <encoding>] [--etc <etc>] [--failover-on-shutdown] [--force] |
| [--global-max-size <globalMaxSize>] [--home <home>] [--host <host>] |
| [--http-host <httpHost>] [--http-port <httpPort>] |
| [--java-options <javaOptions>] [--jdbc] |
| [--jdbc-bindings-table-name <jdbcBindings>] |
| [--jdbc-connection-url <jdbcURL>] |
| [--jdbc-driver-class-name <jdbcClassName>] |
| [--jdbc-large-message-table-name <jdbcLargeMessages>] |
| [--jdbc-lock-expiration <jdbcLockExpiration>] |
| [--jdbc-lock-renew-period <jdbcLockRenewPeriod>] |
| [--jdbc-message-table-name <jdbcMessages>] |
| [--jdbc-network-timeout <jdbcNetworkTimeout>] |
| [--jdbc-node-manager-table-name <jdbcNodeManager>] |
| [--jdbc-page-store-table-name <jdbcPageStore>] |
| [--journal-device-block-size <journalDeviceBlockSize>] [--mapped] |
| [--max-hops <maxHops>] [--message-load-balancing <messageLoadBalancing>] |
| [--name <name>] [--nio] [--no-amqp-acceptor] [--no-autocreate] |
| [--no-autotune] [--no-fsync] [--no-hornetq-acceptor] |
| [--no-mqtt-acceptor] [--no-stomp-acceptor] [--no-web] [--paging] |
| [--password <password>] [--ping <ping>] [--port-offset <portOffset>] |
| [--queues <queues>] [--relax-jolokia] [--replicated] [--require-login] |
| [--role <role>] [--security-manager <securityManager>] [--shared-store] |
| [--silent] [--slave] [--ssl-key <sslKey>] |
| [--ssl-key-password <sslKeyPassword>] [--ssl-trust <sslTrust>] |
| [--ssl-trust-password <sslTrustPassword>] [--static-cluster <staticNode>] |
| [--use-client-auth] [--user <user>] [--verbose] [--] <directory> |
| |
| OPTIONS |
| --addresses <addresses> |
| Comma separated list of addresses |
| |
| --aio |
| Sets the journal as asyncio. |
| |
| --allow-anonymous |
| Enables anonymous configuration on security, opposite of |
| --require-login (Default: input) |
| |
| --autocreate |
| Auto create addresses. (default: true) |
| |
| --blocking |
| Block producers when address becomes full, opposite of --paging |
| (Default: false) |
| |
| --cluster-password <clusterPassword> |
| The cluster password to use for clustering. (Default: input) |
| |
| --cluster-user <clusterUser> |
| The cluster user to use for clustering. (Default: input) |
| |
| --clustered |
| Enable clustering |
| |
| --data <data> |
| Directory where ActiveMQ data are stored. Paths can be absolute or |
| relative to artemis.instance directory ('data' by default) |
| |
| --default-port <defaultPort> |
| The port number to use for the main 'artemis' acceptor (Default: |
| 61616) |
| |
| --disable-persistence |
| Disable message persistence to the journal |
| |
| --encoding <encoding> |
| The encoding that text files should use |
| |
| --etc <etc> |
| Directory where ActiveMQ configuration is located. Paths can be |
| absolute or relative to artemis.instance directory ('etc' by |
| default) |
| |
| --failover-on-shutdown |
| Valid for shared store: will shutdown trigger a failover? (Default: |
| false) |
| |
| --force |
| Overwrite configuration at destination directory |
| |
| --global-max-size <globalMaxSize> |
| Maximum amount of memory which message data may consume (Default: |
| Undefined, half of the system's memory) |
| |
| --home <home> |
| Directory where ActiveMQ Artemis is installed |
| |
| --host <host> |
| The host name of the broker (Default: 0.0.0.0 or input if clustered) |
| |
| --http-host <httpHost> |
| The host name to use for embedded web server (Default: localhost) |
| |
| --http-port <httpPort> |
| The port number to use for embedded web server (Default: 8161) |
| |
| --java-options <javaOptions> |
| Extra java options to be passed to the profile |
| |
| --jdbc |
| It will activate jdbc |
| |
| --jdbc-bindings-table-name <jdbcBindings> |
| Name of the jdbc bindings table |
| |
| --jdbc-connection-url <jdbcURL> |
| The connection used for the database |
| |
| --jdbc-driver-class-name <jdbcClassName> |
| JDBC driver classname |
| |
| --jdbc-large-message-table-name <jdbcLargeMessages> |
| Name of the large messages table |
| |
| --jdbc-lock-expiration <jdbcLockExpiration> |
| Lock expiration |
| |
| --jdbc-lock-renew-period <jdbcLockRenewPeriod> |
| Lock Renew Period |
| |
| --jdbc-message-table-name <jdbcMessages> |
| Name of the jdbc messages table |
| |
| --jdbc-network-timeout <jdbcNetworkTimeout> |
| Network timeout |
| |
| --jdbc-node-manager-table-name <jdbcNodeManager> |
| Name of the jdbc node manager table |
| |
| --jdbc-page-store-table-name <jdbcPageStore> |
| Name of the page store messages table |
| |
| --journal-device-block-size <journalDeviceBlockSize> |
| The block size by the device, default at 4096. |
| |
| --mapped |
| Sets the journal as mapped. |
| |
| --max-hops <maxHops> |
| Number of hops on the cluster configuration |
| |
| --message-load-balancing <messageLoadBalancing> |
| Load balancing policy on cluster. [ON_DEMAND (default) | STRICT | |
| OFF] |
| |
| --name <name> |
| The name of the broker (Default: same as host) |
| |
| --nio |
| Sets the journal as nio. |
| |
| --no-amqp-acceptor |
| Disable the AMQP specific acceptor. |
| |
| --no-autocreate |
| Disable Auto create addresses. |
| |
| --no-autotune |
| Disable auto tuning on the journal. |
| |
| --no-fsync |
| Disable usage of fdatasync (channel.force(false) from java nio) on |
| the journal |
| |
| --no-hornetq-acceptor |
| Disable the HornetQ specific acceptor. |
| |
| --no-mqtt-acceptor |
| Disable the MQTT specific acceptor. |
| |
| --no-stomp-acceptor |
| Disable the STOMP specific acceptor. |
| |
| --no-web |
| Remove the web-server definition from bootstrap.xml |
| |
| --paging |
| Page messages to disk when address becomes full, opposite of |
| --blocking (Default: true) |
| |
| --password <password> |
| The user's password (Default: input) |
| |
| --ping <ping> |
| A comma separated string to be passed on to the broker config as |
| network-check-list. The broker will shutdown when all these |
| addresses are unreachable. |
| |
| --port-offset <portOffset> |
| Off sets the ports of every acceptor |
| |
| --queues <queues> |
| Comma separated list of queues with the option to specify a routing |
| type. (ex: --queues myqueue,mytopic:multicast) |
| |
| --relax-jolokia |
| disable strict checking on jolokia-access.xml |
| |
| --replicated |
| Enable broker replication |
| |
| --require-login |
| This will configure security to require user / password, opposite of |
| --allow-anonymous |
| |
| --role <role> |
| The name for the role created (Default: amq) |
| |
| --security-manager <securityManager> |
| Which security manager to use - jaas or basic (Default: jaas) |
| |
| --shared-store |
| Enable broker shared store |
| |
| --silent |
| It will disable all the inputs, and it would make a best guess for |
| any required input |
| |
| --slave |
| Valid for shared store or replication: this is a slave server? |
| |
| --ssl-key <sslKey> |
| The key store path for embedded web server |
| |
| --ssl-key-password <sslKeyPassword> |
| The key store password |
| |
| --ssl-trust <sslTrust> |
| The trust store path in case of client authentication |
| |
| --ssl-trust-password <sslTrustPassword> |
| The trust store password |
| |
| --static-cluster <staticNode> |
| Cluster node connectors list, separated by comma: Example |
| "tcp://server:61616,tcp://server2:61616,tcp://server3:61616" |
| |
| --use-client-auth |
| If the embedded server requires client authentication |
| |
| --user <user> |
| The username (Default: input) |
| |
| --verbose |
| Adds more information on the execution |
| |
| -- |
| This option can be used to separate command-line options from the |
| list of argument, (useful when arguments might be mistaken for |
| command-line options |
| |
| <directory> |
| The instance directory to hold the broker's configuration and data. |
| Path must be writable.</pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Some of these options may be mandatory in certain configurations and the system may ask you for additional input, e.g.:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="sh">./artemis create /usr/server |
| Creating ActiveMQ Artemis instance at: /user/server |
| |
| <span class="nt">--user</span>: is a mandatory property! |
| Please provide the default username: |
| admin |
| |
| <span class="nt">--password</span>: is mandatory with this configuration: |
| Please provide the default password: |
| |
| |
| <span class="nt">--allow-anonymous</span> | <span class="nt">--require-login</span>: is a mandatory property! |
| Allow anonymous access?, valid values are Y,N,True,False |
| y |
| |
| Auto tuning journal ... |
| <span class="k">done</span><span class="o">!</span> Your system can make 0.34 writes per millisecond, your journal-buffer-timeout will be 2956000 |
| |
| You can now start the broker by executing: |
| |
| <span class="s2">"/user/server/bin/artemis"</span> run |
| |
| Or you can run the broker <span class="k">in </span>the background using: |
| |
| <span class="s2">"/user/server/bin/artemis-service"</span> start</code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="starting-and-stopping-a-broker-instance"><a class="anchor" href="#starting-and-stopping-a-broker-instance"></a><a class="link" href="#starting-and-stopping-a-broker-instance">3. Starting and Stopping a Broker Instance</a></h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Assuming you created the broker instance under <code>/var/lib/mybroker</code> all you need to do start running the broker instance is execute:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="sh">/var/lib/mybroker/bin/artemis run</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Now that the broker is running, you can optionally run some of the included examples to verify the broker is running properly.</p> |
| </div> |
| <div class="paragraph"> |
| <p>To stop the Apache ActiveMQ Artemis instance you will use the same <code>artemis</code> script, but with the <code>stop</code> argument. |
| Example:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="sh">/var/lib/mybroker/bin/artemis stop</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Please note that Apache ActiveMQ Artemis requires a Java 11 or later.</p> |
| </div> |
| <div class="paragraph"> |
| <p>By default the <code>etc/bootstrap.xml</code> configuration is used. |
| The configuration can be changed e.g. by running <code>./artemis run -- xml:path/to/bootstrap.xml</code> or another config of your choosing.</p> |
| </div> |
| <div class="paragraph"> |
| <p>Environment variables are used to provide ease of changing ports, hosts and data directories used and can be found in <code>etc/artemis.profile</code> on linux and <code>etc\artemis.profile.cmd</code> on Windows.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="configuration-files"><a class="anchor" href="#configuration-files"></a><a class="link" href="#configuration-files">4. Configuration Files</a></h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>These are the files you’re likely to find in the <code>etc</code> directory of a default broker instance with a short explanation of what they configure. |
| Scroll down further for additional details as appropriate.</p> |
| </div> |
| <div class="dlist"> |
| <dl> |
| <dt class="hdlist1">artemis.profile</dt> |
| <dd> |
| <p>system properties and JVM arguments (e.g. <code>Xmx</code>, <code>Xms</code>, etc.)</p> |
| </dd> |
| <dt class="hdlist1">artemis-roles.properties</dt> |
| <dd> |
| <p>user/role mapping for the default <a href="security.html#propertiesloginmodule">properties-based JAAS login module</a></p> |
| </dd> |
| <dt class="hdlist1">artemis-users.properties</dt> |
| <dd> |
| <p>user/password for the default <a href="security.html#propertiesloginmodule">properties-based JAAS login module</a></p> |
| </dd> |
| <dt class="hdlist1">bootstrap.xml</dt> |
| <dd> |
| <p>embedded web server, security, location of <code>broker.xml</code></p> |
| </dd> |
| <dt class="hdlist1">broker.xml</dt> |
| <dd> |
| <p>core broker configuration, e.g. acceptors, addresses, queues, diverts, clustering; <a href="configuration-index.html#configuration-reference">full reference</a></p> |
| </dd> |
| <dt class="hdlist1">jolokia-access.xml</dt> |
| <dd> |
| <p><a href="https://jolokia.org/reference/html/security.html">security for Jolokia</a>, specifically Cross-Origin Resource Sharing (CORS)</p> |
| </dd> |
| <dt class="hdlist1">log4j2.properties</dt> |
| <dd> |
| <p><a href="logging.html#logging">logging config</a> like levels, log file locations, etc.</p> |
| </dd> |
| <dt class="hdlist1">login.config</dt> |
| <dd> |
| <p>standard Java configuration for JAAS <a href="security.html#authentication-authorization">security</a></p> |
| </dd> |
| <dt class="hdlist1">management.xml</dt> |
| <dd> |
| <p>remote connectivity and <a href="management.html#role-based-authorisation-for-jmx">security for JMX MBeans</a></p> |
| </dd> |
| </dl> |
| </div> |
| <div class="sect2"> |
| <h3 id="bootstrap-configuration-file"><a class="anchor" href="#bootstrap-configuration-file"></a><a class="link" href="#bootstrap-configuration-file">4.1. Bootstrap Configuration File</a></h3> |
| <div class="paragraph"> |
| <p>The <code>bootstrap.xml</code> file is very simple. |
| Let’s take a look at an example:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="xml"><span class="nt"><broker</span> <span class="na">xmlns=</span><span class="s">"http://activemq.apache.org/schema"</span><span class="nt">></span> |
| |
| <span class="nt"><jaas-security</span> <span class="na">domain=</span><span class="s">"activemq"</span><span class="nt">/></span> |
| |
| <span class="nt"><server</span> <span class="na">configuration=</span><span class="s">"file:/path/to/broker.xml"</span><span class="nt">/></span> |
| |
| <span class="nt"><web</span> <span class="na">path=</span><span class="s">"web"</span><span class="nt">></span> |
| <span class="nt"><binding</span> <span class="na">uri=</span><span class="s">"http://localhost:8161"</span><span class="nt">></span> |
| <span class="nt"><app</span> <span class="na">url=</span><span class="s">"activemq-branding"</span> <span class="na">war=</span><span class="s">"activemq-branding.war"</span><span class="nt">/></span> |
| <span class="nt"><app</span> <span class="na">url=</span><span class="s">"artemis-plugin"</span> <span class="na">war=</span><span class="s">"artemis-plugin.war"</span><span class="nt">/></span> |
| <span class="nt"><app</span> <span class="na">url=</span><span class="s">"console"</span> <span class="na">war=</span><span class="s">"console.war"</span><span class="nt">/></span> |
| <span class="nt"></binding></span> |
| <span class="nt"></web></span> |
| <span class="nt"></broker></span></code></pre> |
| </div> |
| </div> |
| <div class="dlist"> |
| <dl> |
| <dt class="hdlist1">jaas-security</dt> |
| <dd> |
| <p>Configures JAAS-based security for the server. |
| The <code>domain</code> attribute refers to the relevant login module entry in <code>login.config</code>. |
| If different behavior is needed then a custom security manager can be configured by replacing <code>jaas-security</code> with <code>security-manager</code>. |
| See the "Custom Security Manager" section in the <a href="security.html#authentication-authorization">security chapter</a> for more details.</p> |
| </dd> |
| <dt class="hdlist1">server</dt> |
| <dd> |
| <p>Instantiates a core server using the configuration file from the <code>configuration</code> attribute. |
| This is the main broker POJO necessary to do all the real messaging work.</p> |
| </dd> |
| <dt class="hdlist1">web</dt> |
| <dd> |
| <p>Configures an embedded web server for things like the admin console.</p> |
| </dd> |
| </dl> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="broker-configuration-file"><a class="anchor" href="#broker-configuration-file"></a><a class="link" href="#broker-configuration-file">4.2. Broker configuration file</a></h3> |
| <div class="paragraph"> |
| <p>The configuration for the Apache ActiveMQ Artemis core broker is contained in <code>broker.xml</code>.</p> |
| </div> |
| <div class="paragraph"> |
| <p>There are many attributes which you can configure for Apache ActiveMQ Artemis. |
| In most cases the defaults will do fine, in fact every attribute can be defaulted which means a file with a single empty <code>configuration</code> element is a valid configuration file. |
| The different configuration will be explained throughout the manual or you can refer to the configuration reference <a href="configuration-index.html#configuration-reference">here</a>.</p> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="other-use-cases"><a class="anchor" href="#other-use-cases"></a><a class="link" href="#other-use-cases">5. Other Use-Cases</a></h2> |
| <div class="sectionbody"> |
| <div class="sect2"> |
| <h3 id="system-property-substitution"><a class="anchor" href="#system-property-substitution"></a><a class="link" href="#system-property-substitution">5.1. System Property Substitution</a></h3> |
| <div class="paragraph"> |
| <p>It is possible to use system property substitution in all the configuration files. |
| by replacing a value with the name of a system property. |
| Here is an example of this with a connector configuration:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="xml"><span class="nt"><connector</span> <span class="na">name=</span><span class="s">"netty"</span><span class="nt">></span>tcp://${activemq.remoting.netty.host:localhost}:${activemq.remoting.netty.port:61616}<span class="nt"></connector></span></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Here you can see we have replaced 2 values with system properties <code>activemq.remoting.netty.host</code> and <code>activemq.remoting.netty.port</code>. |
| These values will be replaced by the value found in the system property if there is one, if not they default back to <code>localhost</code> or <code>61616</code> respectively. |
| It is also possible to not supply a default (i.e. <code>${activemq.remoting.netty.host}</code>), however the system property <em>must</em> be supplied in that case.</p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="windows-server"><a class="anchor" href="#windows-server"></a><a class="link" href="#windows-server">5.2. Windows Server</a></h3> |
| <div class="paragraph"> |
| <p>On windows you will have the option to run ActiveMQ Artemis as a service. |
| Just use the following command to install it:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="nowrap"> $ ./artemis-service.exe install</pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The create process should give you a hint of the available commands available for the artemis-service.exe</p> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="adding-bootstrap-dependencies"><a class="anchor" href="#adding-bootstrap-dependencies"></a><a class="link" href="#adding-bootstrap-dependencies">5.3. Adding Bootstrap Dependencies</a></h3> |
| <div class="paragraph"> |
| <p>Bootstrap dependencies like logging handlers must be accessible by the log manager at boot time. |
| Package the dependency in a jar and put it on the boot classpath before of log manager jar. |
| This can be done appending the jar at the variable <code>JAVA_ARGS</code>, defined in <code>artemis.profile</code>, with the option <code>-Xbootclasspath/a</code>.</p> |
| </div> |
| <div class="admonitionblock note"> |
| <table> |
| <tr> |
| <td class="icon"> |
| <i class="fa icon-note" title="Note"></i> |
| </td> |
| <td class="content"> |
| the environment variable <code>JAVA_ARGS_APPEND</code> can be used to append or override options. |
| </td> |
| </tr> |
| </table> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="adding-runtime-dependencies"><a class="anchor" href="#adding-runtime-dependencies"></a><a class="link" href="#adding-runtime-dependencies">5.4. Adding Runtime Dependencies</a></h3> |
| <div class="paragraph"> |
| <p>Runtime dependencies like diverts, transformers, broker plugins, JDBC drivers, password decoders, etc. must be accessible by the broker at runtime. |
| Package the dependency in a jar, and put it on the broker’s classpath. |
| This can be done by placing the jar file in the <code>lib</code> directory of the broker distribution itself, |
| by placing the jar file in the <code>lib</code> directory of the broker instance, |
| by setting the system property <code>artemis.extra.libs</code> with the directory that contains the jar file, or |
| by setting the environment variable <code>ARTEMIS_EXTRA_LIBS</code> with the directory that contains the jar file, |
| A broker instance does not have a <code>lib</code> directory by default so it may need to be created. |
| It should be on the "top" level with the <code>bin</code>, <code>data</code>, <code>log</code>, etc. |
| directories. |
| The system property <code>artemis.extra.libs</code> is a comma separated list of directories that contains jar files, i.e.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code>-Dartemis.extra.libs=/usr/local/share/java/lib1,/usr/local/share/java/lib2</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The environment variable <code>ARTEMIS_EXTRA_LIBS</code> is a comma separated list of directories that contains jar files and |
| is ignored if the system property <code>artemis.extra.libs</code> is defined, i.e.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code>export ARTEMIS_EXTRA_LIBS=/usr/local/share/java/lib1,/usr/local/share/java/lib2</code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="library-path"><a class="anchor" href="#library-path"></a><a class="link" href="#library-path">5.5. Library Path</a></h3> |
| <div class="paragraph"> |
| <p>If you’re using the <a href="libaio.html#libaio-native-libraries">Asynchronous IO Journal</a> on Linux, you need to specify <code>java.library.path</code> as a property on your Java options. |
| This is done automatically in the scripts.</p> |
| </div> |
| <div class="paragraph"> |
| <p>If you don’t specify <code>java.library.path</code> at your Java options then the JVM will use the environment variable <code>LD_LIBRARY_PATH</code>.</p> |
| </div> |
| <div class="paragraph"> |
| <p>You will need to make sure libaio is installed on Linux. |
| For more information refer to the <a href="libaio.html#runtime-dependencies">libaio chapter</a>.</p> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </body> |
| </html> |