<?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" version="EE-3.4.2"
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" host="localhost" port="8081" doc:name="Jetty"/>
</flow>
</mule>
Jetty Transport
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. |
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: