Embedded Web Server
Apache ActiveMQ Artemis embeds the Jetty web server. Its main purpose is to host the Management Console. However, it can also host other web applications like the REST interface or even Spring-based web applications (e.g. using Camel).
Configuration
The embedded Jetty instance is configured in etc/bootstrap.xml via the web
element, e.g.:
<web bind="http://localhost:8161" path="web">
<app url="activemq-branding" war="activemq-branding.war"/>
<app url="artemis-plugin" war="artemis-plugin.war"/>
<app url="console" war="console.war"/>
</web>
The web element has the following attributes:
bindThe protocol to use (i.e.httporhttps) as well as the host and port on which to listen.pathThe name of the subdirectory in which to find the web application archives (i.e. WAR files). This is a subdirectory of the broker's home or instance directory.clientAuthWhether or not clients should present an SSL certificate when they connect. Only applicable when usinghttps.passwordCodecThe custom coded to use for unmasking thekeystorePasswordandtruststorePassword.keystorePathThe location on disk of the keystore. Only applicable when usinghttps.keystorePasswordThe password to the keystore. Only applicable when usinghttps. Can be masked usingENC()syntax or by definingpasswordCodec. See more in the password masking chapter.truststorePathThe location on disk fo the truststore. Only applicable when usinghttps.truststorePasswordThe password to the truststore. Only applicable when usinghttps. Can be masked usingENC()syntax or by definingpasswordCodec. See more in the password masking chapter.
Each web application should be defined in an app element. The app element
has the following attributes:
urlThe context to use for the web application.warThe name of the web application archive on disk.
It's also possible to configure HTTP/S request logging via the request-log
element which has the following attributes:
filenameThe full path of the request log. This attribute is required.appendWhether or not to append to the existing log or truncate it. Boolean flag.extendedWhether or not to use the extended request log format. Boolean flag.logCookiesLogging of the request cookies. Boolean flag.logTimeZoneThe output file name of the request log.filenameDateFormatThe log file name date format.retainDaysThe number of days before rotated log files are deleted.ignorePathsRequest paths that will not be logged. Comma delimited list.logDateFormatThe timestamp format string for request log entries.logLocaleThe locale of the request log.logLatencyLogging of request processing time. Boolean flag.logServerLogging of the request hostname. Boolean flag.preferProxiedForAddressWhether the actual IP address of the connection or the IP address from theX-Forwarded-Forheader will be logged. Boolean flag.
These attributes are essentially passed straight through to the underlying
org.eclipse.jetty.server.NCSARequestLog
instance. Default values are based on this implementation.
Here is an example configuration:
<web bind="http://localhost:8161" path="web">
<app url="activemq-branding" war="activemq-branding.war"/>
<app url="artemis-plugin" war="artemis-plugin.war"/>
<app url="console" war="console.war"/>
<request-log filename="${artemis.instance}/log/http-access-yyyy_MM_dd.log" append="true" extended="true"/>
</web>