Red Hat Training

A Red Hat training course is available for Red Hat Fuse

2.2. Configuring the Wrapper


The service wrapper is configured by the ServiceName-wrapper.conf file, which is located under the InstallDir/etc/ directory.


The service wrapper is configured by the ServiceName-wrapper.conf file, which is located under the InstallDir/etc/ directory.
There are several kinds of setting you might want to change including:
  • Environment variables
  • Properties passed to the JVM
  • Classpath
  • JMX settings
  • Logging settings
You must set the JAVA_HOME environment variable.

Specifying the Red Hat JBoss Fuse's environment

A broker's environment is controlled by the following environment variables:
  • JAVA_HOME—the Java runtime install directory.
  • KARAF_HOME—the location of the Red Hat JBoss Fuse install directory.
  • KARAF_BASE—the root directory containing the configuration and OSGi data specific to the broker instance.
    The configuration for the broker instance is stored in the KARAF_BASE/conf directory. Other data relating to the OSGi runtime is also stored beneath the base directory.
  • KARAF_DATA—the directory containing the logging and persistence data for the broker.

Example 2.1. Default Environment Settings

On Windows, you can set JAVA_HOME either as a system variable in the registry (for example, through the system control panel) or in ServiceName-wrapper.conf, as shown in the preceding example. Setting JAVA_HOME as a regular environment variable, however, does not work.

Passing parameters to the JVM

If you want to pass parameters to the JVM, you do so by setting wrapper properties using the form<n>. <n> is a sequence number that must be distinct for each parameter.
One of the most useful things you can do by passing additional parameters to the JVM is to set Java system properties. The syntax for setting a Java system property is<n>=-DPropName=PropValue.
Example 2.2, “Default Java System Properties” shows the default Java properties.

Example 2.2. Default Java System Properties

# note that n is the parameter number starting from 1."%KARAF_HOME%""%KARAF_BASE%""%KARAF_DATA%""%JAVA_HOME%/jre/lib/endorsed;%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed""%JAVA_HOME%/jre/lib/ext;%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"

Adding classpath entries

You add classpath entries using the syntax<n>. <n> is a sequence number that must be distinct for each classpath entry.
Example 2.3, “Default Wrapper Classpath” shows the default classpath entries.

Example 2.3. Default Wrapper Classpath

JMX configuration

The default service wrapper configuration does not enable JMX. It does, however, include template properties for enabling JMX. To enable JMX:
  1. Locate the line # Uncomment to enable jmx.
    There are three properties, shown in Example 2.4, “Wrapper JMX Properties”, that are used to configure JMX.

    Example 2.4. Wrapper JMX Properties

    # Uncomment to enable jmx
  2. Remove the # from in front of each of the properties.
  3. Replace the n in each property to a number that fits into the sequence of addition properties established in the configuration.
You can change the settings to use a different port or secure the JMX connection.
For more information about using JMX see Chapter 13, Configuring JMX.

Configuring logging

The wrapper's logging in configured using the properties described in Table 2.2, “Wrapper Logging Properties”.

Table 2.2. Wrapper Logging Properties

Specifies how the logging information sent to the console is formated. The format consists of the following tokens:
  • L—log level
  • P—prefix
  • D—thread name
  • T—time
  • Z—time in milliseconds
  • U—approximate uptime in seconds (based on internal tick counter)
  • M—message
wrapper.console.loglevelSpecifies the logging level displayed on the console.
wrapper.logfileSpecifies the file used to store the log.
wrapper.logfile.formatSpecifies how the logging information sent to the log file is formated.
wrapper.console.loglevelSpecifies the logging level sent to the log file.
wrapper.console.maxsizeSpecifies the maximum size, in bytes, that the log file can grow to before the log is archived. The default value of 0 disables log rolling.
wrapper.console.maxfilesSpecifies the maximum number of archived log files which will be allowed before old files are deleted. The default value of 0 implies no limit.
wrapper.syslog.loglevelSpecifies the logging level for the sys/event log output.
For more information about Red Hat JBoss Fuse logging see Chapter 16, Logging.