LibraryLink ToToggle FramesPrintFeedback

Configuring the Jetty Runtime

The Jetty runtime is used by HTTP service providers and HTTP consumers using a decoupled endpoint. The runtime's thread pool can be configured, and you can also set a number of the security settings for an HTTP service provider through the Jetty runtime.

The elements used to configure the Jetty runtime are defined in the namespace http://cxf.apache.org/transports/http-jetty/configuration. It is commonly referred to using the prefix httpj. In order to use the Jetty configuration elements you must add the lines shown in Example 8.14 to the beans element of your endpoint's configuration file. In addition, you must add the configuration elements' namespace to the xsi:schemaLocation attribute.


The httpj:engine-factory element is the root element used to configure the Jetty runtime used by an application. It has a single required attribute, bus, whose value is the name of the Bus that manages the Jetty instances being configured.

[Tip]Tip

The value is typically cxf which is the name of the default Bus instance.

The httpj:engine-factory element has three children that contain the information used to configure the HTTP ports instantiated by the Jetty runtime factory. The children are described in Table 8.7.


The httpj:engine element is used to configure specific instances of the Jetty runtime. It has a single attribute, port, that specifies the number of the port being managed by the Jetty instance.

[Tip]Tip

You can specify a value of 0 for the port attribute. Any threading properties specified in an httpj:engine element with its port attribute set to 0 are used as the configuration for all Jetty listeners that are not explicitly configured.

Each httpj:engine element can have two children: one for configuring security properties and one for configuring the Jetty instance's thread pool. For each type of configuration you can either directly provide the configuration information or you can provide a reference to a set of configuration properties defined in the parent httpj:engine-factory element.

The child elements used to provide the configuration properties are described in Table 8.8.


You can configure the size of a Jetty instance's thread pool by either:

  • Specifying the size of the thread pool using a identifiedThreadingParameters element in the engine-factory element. You then refer to the element using a threadingParametersRef element.

  • Specifying the size of the of the thread pool directly using a threadingParameters element.

The threadingParameters has two attributes to specify the size of a thread pool. The attributes are described in Table 8.9.

[Note]Note

The httpj:identifiedThreadingParameters element has a single child threadingParameters element.


Example 8.15 shows a configuration fragment that configures a Jetty instance on port number 9001.