Contact Us 1-800-596-4880

Jetty Transport

Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version.

The Jetty transport provides support for exposing applications over HTTP by embedding a light-weight Jetty server. The Jetty SSL Transport works the same way but over SSL. You can only define inbound endpoints with this transport.

The Javadoc for this transport can be found below:

The connector allows Mule to expose Mule Services over HTTP using a Jetty HTTP server. A single Jetty server is created for each connector instance. One connector can serve many endpoints. Users should rarely need to have more than one Jetty connector. The Jetty connector can be configured using a Jetty XML config file, but the default configuration is sufficient for most scenarios.

Attributes of the Connector

These attributes are for the optional global connector, jetty:connector.

Name Type Required Default Description

name

string

Yes

Jetty

The name of the connector that can be referenced in a flow.

configFile

string

no

The location of the Jetty config file to configure this connector with.

Acceptors

int

no

1

The number of acceptor threads.

resourceBase

string

no

Specifies a local path where files will be served from. The local path gets mapped directly to the path on the 'serverUrl'.

useContinuations

boolean

no

Whether to use continuations to free up connections in high load situations.

doc:name

string

Only for Studio configurations

Jetty

A descriptive name for the connector. Not required in Mule Standalone configuration.

Child Elements of the Connector

Name Cardinality Description

webapps

0..1

Allows configuring of a directory which contains WAR files to be served out by Jetty.

Endpoints

Jetty endpoints are configured the same way as HTTP endpoints. Note that the Jetty transport can only be used for inbound endpoints.

For example:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:jetty="http://www.mulesoft.org/schema/mule/jetty" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/jetty http://www.mulesoft.org/schema/mule/jetty/current/mule-jetty.xsd">
    <flow name="somethingFlow1" doc:name="somethingFlow1">

        <jetty:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8081/path" doc:name="Jetty"/>

    </flow>

</mule>