Contact Us 1-800-596-4880

Jetty Transport

Mule runtime engine version 3.8 reached its End of Life on November 16, 2021. For more information, contact your Customer Success Manager to determine how to 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 Description

name

The name of the connector in a flow.

Type: string
Required: yes
Default: Jetty

configFile

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

Type: string
Required: no
Default: none

Acceptors

The number of acceptor threads.

Type: integer
Required: no
Default: 1

resourceBase

Specifies a local path from which files are served. The local path gets mapped directly to the path on the serverUrl.

Type: string
Required: no
Default: none

useContinuations

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

Type: boolean
Required: no
Default: none

doc:name

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

Type: string
Required: Only for Studio configurations
Default: Jetty

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 FTP 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>