Contact Us 1-800-596-4880

Jetty Transport

The Jetty transport provides support for exposing services 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 here.

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 <connector…​>

Name Type Required Default Description

configFile

string

no

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

useContinuations

boolean

no

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

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'.

Child Elements of <connector…​>

Name Cardinality Description

webapps

0..1

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

For example:

<?xml version="1.0" encoding="UTF-8" ?> <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jetty="http://www.mulesoft.org/schema/mule/jetty" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/jetty http://www.mulesoft.org/schema/mule/jetty/3.2/mule-jetty.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd">  <jetty:connector name="httpConnector" useContinuations="true" /> ...

Endpoints

Jetty endpoints are configured the same way as HTTP endpoints.

Note: Only inbound endpoints can use the Jetty transport.

For example:

<jetty:endpoint name="serverEndpoint" host="localhost" port="60203" path="services/Foo" synchronous="false" />
 <model name="main">
  <service name="testComponent">
    <inbound>
      <inbound-endpoint ref="serverEndpoint" />
     </inbound>
    <test:component appendString="Received" />
</service></model>