2014-12-11 07:17:29 -05:00
|
|
|
# Using the Server
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
This chapter will familiarise you with how to use the Apache ActiveMQ Artemis
|
|
|
|
server.
|
2014-12-04 10:25:29 -05:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2015-04-15 18:45:37 -04:00
|
|
|
This document will refer to the full path of the directory where the ActiveMQ
|
2021-06-15 13:16:11 -04:00
|
|
|
distribution has been extracted to as `${ARTEMIS_HOME}`.
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-08 15:46:38 -05:00
|
|
|
## Installation
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
The following highlights some important folders on the distribution:
|
|
|
|
```
|
|
|
|
|___ bin
|
|
|
|
|
|
|
|
|
|___ examples
|
|
|
|
| |___ common
|
|
|
|
| |___ features
|
|
|
|
| |___ perf
|
|
|
|
| |___ protocols
|
|
|
|
|
|
|
|
|
|___ lib
|
|
|
|
| |___ client
|
|
|
|
|
|
|
|
|
|___ schema
|
|
|
|
|
|
|
|
|
|___ web
|
|
|
|
|___ api
|
|
|
|
|___ hacking-guide
|
|
|
|
|___ migration-guide
|
|
|
|
|___ user-manual
|
|
|
|
```
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
- `bin` - binaries and scripts needed to run ActiveMQ Artemis.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
- `examples` - All manner of examples. Please refer to the [examples](examples.md)
|
|
|
|
chapter for details on how to run them.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
- `lib` - jars and libraries needed to run ActiveMQ Artemis
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
- `schema` - XML Schemas used to validate ActiveMQ Artemis configuration files
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
- `web` - The folder where the web context is loaded when the broker runs.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
- `api` - The api documentation is placed under the web folder.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
- `user-manual` - The user manual is placed under the web folder.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
|
|
|
|
2015-04-15 18:45:37 -04:00
|
|
|
## Creating a Broker Instance
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
A broker *instance* is the directory containing all the configuration and runtime
|
|
|
|
data, such as logs and message journal, associated with a broker process. It is
|
2018-03-09 10:07:38 -05:00
|
|
|
recommended that you do *not* create the instance directory under
|
|
|
|
`${ARTEMIS_HOME}`. This separation is encouraged so that you can more easily
|
|
|
|
upgrade when the next version of ActiveMQ Artemis is released.
|
|
|
|
|
|
|
|
On Unix systems, it is a common convention to store this kind of runtime data
|
|
|
|
under the `/var/lib` directory. For example, to create an instance at
|
2021-06-15 13:16:11 -04:00
|
|
|
`/var/lib/mybroker`, run the following commands in your command line shell:
|
2018-03-09 10:07:38 -05:00
|
|
|
|
|
|
|
```sh
|
|
|
|
cd /var/lib
|
|
|
|
${ARTEMIS_HOME}/bin/artemis create mybroker
|
|
|
|
```
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2015-04-15 18:45:37 -04:00
|
|
|
A broker instance directory will contain the following sub directories:
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
- `bin`: holds execution scripts associated with this instance.
|
|
|
|
- `data`: holds the data files used for storing persistent messages
|
2021-06-15 13:16:11 -04:00
|
|
|
- `etc`: hold the instance configuration files
|
|
|
|
- `lib`: holds any custom runtime Java dependencies like transformers,
|
|
|
|
plugins, interceptors, etc.
|
2018-03-09 10:07:38 -05:00
|
|
|
- `log`: holds rotating log files
|
|
|
|
- `tmp`: holds temporary files that are safe to delete between broker runs
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
At this point you may want to adjust the default configuration located in the
|
|
|
|
`etc` directory.
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-08 15:46:38 -05:00
|
|
|
### Options
|
2018-03-09 10:07:38 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
There are several options you can use when creating an instance. For a full list
|
|
|
|
of options use the `help` command:
|
2015-05-21 11:51:48 -04:00
|
|
|
|
|
|
|
```
|
2021-06-15 13:16:11 -04:00
|
|
|
$./artemis help create
|
|
|
|
NAME
|
|
|
|
artemis create - creates a new broker instance
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
SYNOPSIS
|
2017-02-08 16:23:52 -05:00
|
|
|
artemis create [--addresses <addresses>] [--aio] [--allow-anonymous]
|
2017-04-24 03:49:32 -04:00
|
|
|
[--autocreate] [--blocking] [--cluster-password <clusterPassword>]
|
2017-02-08 16:23:52 -05:00
|
|
|
[--cluster-user <clusterUser>] [--clustered] [--data <data>]
|
|
|
|
[--default-port <defaultPort>] [--disable-persistence]
|
2018-01-26 09:26:47 -05:00
|
|
|
[--encoding <encoding>] [--etc <etc>] [--failover-on-shutdown] [--force]
|
2017-04-24 03:49:32 -04:00
|
|
|
[--global-max-size <globalMaxSize>] [--home <home>] [--host <host>]
|
|
|
|
[--http-host <httpHost>] [--http-port <httpPort>]
|
2021-06-15 13:16:11 -04:00
|
|
|
[--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]
|
2017-04-24 03:49:32 -04:00
|
|
|
[--silent] [--slave] [--ssl-key <sslKey>]
|
|
|
|
[--ssl-key-password <sslKeyPassword>] [--ssl-trust <sslTrust>]
|
2021-06-15 13:16:11 -04:00
|
|
|
[--ssl-trust-password <sslTrustPassword>] [--staticCluster <staticNode>]
|
|
|
|
[--use-client-auth] [--user <user>] [--verbose] [--] <directory>
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
OPTIONS
|
|
|
|
--addresses <addresses>
|
|
|
|
Comma separated list of addresses
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--aio
|
|
|
|
Sets the journal as asyncio.
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--allow-anonymous
|
|
|
|
Enables anonymous configuration on security, opposite of
|
|
|
|
--require-login (Default: input)
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--autocreate
|
|
|
|
Auto create addresses. (default: true)
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--blocking
|
|
|
|
Block producers when address becomes full, opposite of --paging
|
|
|
|
(Default: false)
|
2017-04-24 03:49:32 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--cluster-password <clusterPassword>
|
|
|
|
The cluster password to use for clustering. (Default: input)
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--cluster-user <clusterUser>
|
|
|
|
The cluster user to use for clustering. (Default: input)
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--clustered
|
|
|
|
Enable clustering
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--data <data>
|
|
|
|
Directory where ActiveMQ data are stored. Paths can be absolute or
|
|
|
|
relative to artemis.instance directory ('data' by default)
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--default-port <defaultPort>
|
|
|
|
The port number to use for the main 'artemis' acceptor (Default:
|
|
|
|
61616)
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--disable-persistence
|
|
|
|
Disable message persistence to the journal
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--encoding <encoding>
|
|
|
|
The encoding that text files should use
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--etc <etc>
|
|
|
|
Directory where ActiveMQ configuration is located. Paths can be
|
|
|
|
absolute or relative to artemis.instance directory ('etc' by
|
|
|
|
default)
|
2018-01-26 09:26:47 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--failover-on-shutdown
|
|
|
|
Valid for shared store: will shutdown trigger a failover? (Default:
|
|
|
|
false)
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--force
|
|
|
|
Overwrite configuration at destination directory
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--global-max-size <globalMaxSize>
|
|
|
|
Maximum amount of memory which message data may consume (Default:
|
|
|
|
Undefined, half of the system's memory)
|
2017-04-24 03:49:32 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--home <home>
|
|
|
|
Directory where ActiveMQ Artemis is installed
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--host <host>
|
|
|
|
The host name of the broker (Default: 0.0.0.0 or input if clustered)
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--http-host <httpHost>
|
|
|
|
The host name to use for embedded web server (Default: localhost)
|
2017-04-24 03:49:32 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--http-port <httpPort>
|
|
|
|
The port number to use for embedded web server (Default: 8161)
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--java-options <javaOptions>
|
|
|
|
Extra java options to be passed to the profile
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc
|
|
|
|
It will activate jdbc
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc-bindings-table-name <jdbcBindings>
|
2021-09-01 10:39:03 -04:00
|
|
|
Name of the jdbc bindings table
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc-connection-url <jdbcURL>
|
|
|
|
The connection used for the database
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc-driver-class-name <jdbcClassName>
|
|
|
|
JDBC driver classname
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc-large-message-table-name <jdbcLargeMessages>
|
|
|
|
Name of the large messages table
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc-lock-expiration <jdbcLockExpiration>
|
|
|
|
Lock expiration
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc-lock-renew-period <jdbcLockRenewPeriod>
|
|
|
|
Lock Renew Period
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc-message-table-name <jdbcMessages>
|
|
|
|
Name of the jdbc messages table
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc-network-timeout <jdbcNetworkTimeout>
|
|
|
|
Network timeout
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc-node-manager-table-name <jdbcNodeManager>
|
|
|
|
Name of the jdbc node manager table
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--jdbc-page-store-table-name <jdbcPageStore>
|
|
|
|
Name of the page store messages table
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--journal-device-block-size <journalDeviceBlockSize>
|
|
|
|
The block size by the device, default at 4096.
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--mapped
|
|
|
|
Sets the journal as mapped.
|
2017-04-24 03:49:32 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--max-hops <maxHops>
|
|
|
|
Number of hops on the cluster configuration
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--message-load-balancing <messageLoadBalancing>
|
|
|
|
Load balancing policy on cluster. [ON_DEMAND (default) | STRICT |
|
|
|
|
OFF]
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--name <name>
|
|
|
|
The name of the broker (Default: same as host)
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--nio
|
|
|
|
Sets the journal as nio.
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--no-amqp-acceptor
|
|
|
|
Disable the AMQP specific acceptor.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--no-autocreate
|
|
|
|
Disable Auto create addresses.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--no-autotune
|
|
|
|
Disable auto tuning on the journal.
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--no-fsync
|
|
|
|
Disable usage of fdatasync (channel.force(false) from java nio) on
|
|
|
|
the journal
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--no-hornetq-acceptor
|
|
|
|
Disable the HornetQ specific acceptor.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--no-mqtt-acceptor
|
|
|
|
Disable the MQTT specific acceptor.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--no-stomp-acceptor
|
|
|
|
Disable the STOMP specific acceptor.
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--no-web
|
|
|
|
Remove the web-server definition from bootstrap.xml
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--paging
|
|
|
|
Page messages to disk when address becomes full, opposite of
|
|
|
|
--blocking (Default: true)
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--password <password>
|
|
|
|
The user's password (Default: input)
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--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.
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--port-offset <portOffset>
|
|
|
|
Off sets the ports of every acceptor
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--queues <queues>
|
|
|
|
Comma separated list of queues with the option to specify a routing
|
|
|
|
type. (ex: --queues myqueue,mytopic:multicast)
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--relax-jolokia
|
|
|
|
disable strict checking on jolokia-access.xml
|
2017-02-08 16:23:52 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--replicated
|
|
|
|
Enable broker replication
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--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
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
--ssl-trust-password <sslTrustPassword>
|
|
|
|
The trust store password
|
|
|
|
|
|
|
|
--staticCluster <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.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
|
|
|
```
|
2021-06-15 13:16:11 -04:00
|
|
|
|
|
|
|
Some of these options may be mandatory in certain configurations and the
|
|
|
|
system may ask you for additional input, e.g.:
|
|
|
|
|
|
|
|
```sh
|
2018-03-09 10:07:38 -05:00
|
|
|
./artemis create /usr/server
|
|
|
|
Creating ActiveMQ Artemis instance at: /user/server
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
--user: is a mandatory property!
|
|
|
|
Please provide the default username:
|
|
|
|
admin
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
--password: is mandatory with this configuration:
|
|
|
|
Please provide the default password:
|
2015-05-21 11:51:48 -04:00
|
|
|
|
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
--allow-anonymous | --require-login: is a mandatory property!
|
|
|
|
Allow anonymous access?, valid values are Y,N,True,False
|
|
|
|
y
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
Auto tuning journal ...
|
|
|
|
done! Your system can make 0.34 writes per millisecond, your journal-buffer-timeout will be 2956000
|
2017-04-24 03:49:32 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
You can now start the broker by executing:
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
"/user/server/bin/artemis" run
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
Or you can run the broker in the background using:
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
"/user/server/bin/artemis-service" start
|
2015-05-21 11:51:48 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
|
2018-03-08 15:46:38 -05:00
|
|
|
## Starting and Stopping a Broker Instance
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2015-04-15 18:45:37 -04:00
|
|
|
Assuming you created the broker instance under `/var/lib/mybroker` all you need
|
|
|
|
to do start running the broker instance is execute:
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
```sh
|
|
|
|
/var/lib/mybroker/bin/artemis run
|
|
|
|
```
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2015-05-21 11:51:48 -04:00
|
|
|
Now that the broker is running, you can optionally run some of the included
|
2020-11-13 06:07:15 -05:00
|
|
|
examples to verify the broker is running properly.
|
2015-03-04 07:28:20 -05:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
To stop the Apache ActiveMQ Artemis instance you will use the same `artemis`
|
|
|
|
script, but with the `stop` argument. Example:
|
2015-03-04 07:28:20 -05:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
```sh
|
|
|
|
/var/lib/mybroker/bin/artemis stop
|
|
|
|
```
|
2015-03-04 07:28:20 -05:00
|
|
|
|
2022-01-20 09:54:58 -05:00
|
|
|
Please note that Apache ActiveMQ Artemis requires a Java 11 or later.
|
2015-03-04 07:28:20 -05:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
By default the `etc/bootstrap.xml` configuration is used. The configuration can
|
|
|
|
be changed e.g. by running `./artemis run -- xml:path/to/bootstrap.xml` or
|
|
|
|
another config of your choosing.
|
2015-04-15 18:45:37 -04:00
|
|
|
|
|
|
|
Environment variables are used to provide ease of changing ports, hosts and
|
2015-09-29 16:49:01 -04:00
|
|
|
data directories used and can be found in `etc/artemis.profile` on linux and
|
|
|
|
`etc\artemis.profile.cmd` on Windows.
|
2015-03-04 07:28:20 -05:00
|
|
|
|
2014-12-11 07:17:29 -05:00
|
|
|
## Library Path
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
If you're using the [Asynchronous IO Journal](libaio.md) on Linux, you need to
|
|
|
|
specify `java.library.path` as a property on your Java options. This is done
|
|
|
|
automatically in the scripts.
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
If you don't specify `java.library.path` at your Java options then the JVM will
|
|
|
|
use the environment variable `LD_LIBRARY_PATH`.
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
You will need to make sure libaio is installed on Linux. For more information
|
|
|
|
refer to the [libaio chapter](libaio.html#runtime-dependencies).
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2014-12-11 07:17:29 -05:00
|
|
|
## Configuration files
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
These are the files you're likely to find in the `etc` directory of a default
|
|
|
|
broker instance with a short explanation of what they configure. Scroll down
|
|
|
|
further for additional details as appropriate.
|
|
|
|
|
|
|
|
- `artemis.profile` - system properties and JVM arguments (e.g. `Xmx`, `Xms`,
|
|
|
|
etc.)
|
|
|
|
- `artemis-roles.properties` - user/role mapping for the default
|
|
|
|
[properties-based JAAS login module](security.md#propertiesloginmodule)
|
|
|
|
- `artemis-users.properties` - user/password for the default
|
|
|
|
[properties-based JAAS login module](security.md#propertiesloginmodule)
|
|
|
|
- `bootstrap.xml` - embedded web server, security, location of `broker.xml`
|
|
|
|
- `broker.xml` - core broker configuration, e.g. acceptors, addresses, queues,
|
|
|
|
diverts, clustering; [full reference](configuration-index.md).
|
|
|
|
- `jolokia-access.xml` - [security for Jolokia](https://jolokia.org/reference/html/security.html),
|
|
|
|
specifically Cross-Origin Resource Sharing (CORS)
|
2022-09-28 07:18:59 -04:00
|
|
|
- `log4j2.properties` - [logging config](logging.md) like levels, log files
|
2021-06-15 13:16:11 -04:00
|
|
|
locations, etc.
|
|
|
|
- `login.config` - standard Java configuration for JAAS [security](security.md)
|
|
|
|
- `management.xml` - remote connectivity and [security for JMX MBeans](management.md#role-based-authorisation-for-jmx)
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-08 15:46:38 -05:00
|
|
|
### Bootstrap configuration file
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
The `bootstrap.xml` file is very simple. Let's take a look at an example:
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-08 15:46:38 -05:00
|
|
|
```xml
|
2021-12-20 14:46:01 -05:00
|
|
|
<broker xmlns="http://activemq.apache.org/schema">
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-08 15:46:38 -05:00
|
|
|
<jaas-security domain="activemq"/>
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-08 15:46:38 -05:00
|
|
|
<server configuration="file:/path/to/broker.xml"/>
|
|
|
|
|
2021-10-27 09:21:04 -04:00
|
|
|
<web path="web">
|
|
|
|
<binding uri="http://localhost:8161">
|
|
|
|
<app url="activemq-branding" war="activemq-branding.war"/>
|
|
|
|
<app url="artemis-plugin" war="artemis-plugin.war"/>
|
|
|
|
<app url="console" war="console.war"/>
|
|
|
|
</binding>
|
2018-03-08 15:46:38 -05:00
|
|
|
</web>
|
|
|
|
</broker>
|
|
|
|
```
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2019-12-10 16:15:21 -05:00
|
|
|
- `jaas-security` - Configures JAAS-based security for the server. The
|
|
|
|
`domain` attribute refers to the relevant login module entry in
|
|
|
|
`login.config`. If different behavior is needed then a custom security
|
|
|
|
manager can be configured by replacing `jaas-security` with
|
|
|
|
`security-manager`. See the "Custom Security Manager" section in the
|
|
|
|
[security chapter](security.md) for more details.
|
2018-03-08 15:46:38 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
- `server` - Instantiates a core server using the configuration file from the
|
|
|
|
`configuration` attribute. This is the main broker POJO necessary to do all
|
|
|
|
the real messaging work.
|
|
|
|
|
|
|
|
- `web` - Configures an embedded web server for things like the admin console.
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2018-03-08 15:46:38 -05:00
|
|
|
### Broker configuration file
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
The configuration for the Apache ActiveMQ Artemis core broker is contained in
|
|
|
|
`broker.xml`.
|
2014-12-04 10:25:29 -05:00
|
|
|
|
2021-06-15 13:16:11 -04:00
|
|
|
There are many attributes which you can configure for Apache ActiveMQ Artemis. In
|
2018-03-09 10:07:38 -05:00
|
|
|
most cases the defaults will do fine, in fact every attribute can be defaulted
|
|
|
|
which means a file with a single empty `configuration` element is a valid
|
2021-06-15 13:16:11 -04:00
|
|
|
configuration file. The different configuration will be explained throughout the
|
|
|
|
manual or you can refer to the configuration reference [here](configuration-index.md).
|
|
|
|
|
|
|
|
## System Property Substitution
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
```xml
|
|
|
|
<connector name="netty">tcp://${activemq.remoting.netty.host:localhost}:${activemq.remoting.netty.port:61616}</connector>
|
|
|
|
```
|
|
|
|
|
|
|
|
Here you can see we have replaced 2 values with system properties
|
|
|
|
`activemq.remoting.netty.host` and `activemq.remoting.netty.port`. These values
|
|
|
|
will be replaced by the value found in the system property if there is one, if
|
|
|
|
not they default back to `localhost` or `61616` respectively. It is also possible
|
|
|
|
to not supply a default. i.e. `${activemq.remoting.netty.host}`, however the
|
|
|
|
system property *must* be supplied in that case.
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-08 15:46:38 -05:00
|
|
|
## Windows Server
|
2015-05-21 11:51:48 -04:00
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
On windows you will have the option to run ActiveMQ Artemis as a service. Just
|
|
|
|
use the following command to install it:
|
2015-05-21 11:51:48 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
$ ./artemis-service.exe install
|
|
|
|
```
|
|
|
|
|
2018-03-09 10:07:38 -05:00
|
|
|
The create process should give you a hint of the available commands available
|
|
|
|
for the artemis-service.exe
|
2018-01-22 15:47:53 -05:00
|
|
|
|
2019-12-18 04:22:28 -05:00
|
|
|
## Adding Bootstrap Dependencies
|
|
|
|
|
|
|
|
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 `JAVA_ARGS`, defined in `artemis.profile`, with the option `-Xbootclasspath/a`.
|
|
|
|
|
2018-01-22 15:47:53 -05:00
|
|
|
## Adding Runtime Dependencies
|
|
|
|
|
|
|
|
Runtime dependencies like diverts, transformers, broker plugins, JDBC drivers,
|
2018-03-09 10:07:38 -05:00
|
|
|
password decoders, etc. must be accessible by the broker at runtime. Package
|
2018-01-22 15:47:53 -05:00
|
|
|
the dependency in a jar, and put it on the broker's classpath. This can be done
|
2018-03-09 10:07:38 -05:00
|
|
|
by placing the jar file in the `lib` directory of the broker distribution
|
|
|
|
itself or in the `lib` directory of the broker instance. A broker instance does
|
|
|
|
not have a `lib` directory by default so it may need to be created. It should
|
|
|
|
be on the "top" level with the `bin`, `data`, `log`, etc. directories.
|