Nav

HTTP Module Documentation Reference

HTTP connector used to handle and perform HTTP requests.

This class only serves as an extension definition. It's configurations are divided on server ( ) and client ( ) capabilities.

Configurations


Listener Config

Configuration element for a HttpListener.

Parameters

Name Type Description Default Value Required

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x 

Connection

The connection types that can be provided to this configuration.

x 

Base Path

String

Base path to use for all requests that reference this config.

 

Listener Interceptors

 

Connection Types

Listener

Connection provider for a HttpListener, handles the creation of HttpServer instances.

Parameters
Name Type Description Default Value Required

TLS Configuration

Tls

Reference to a TLS config element. This will enable HTTPS for this config.

 

Protocol

Enumeration, one of:

  • HTTP

  • HTTPS

Protocol to use for communication. Valid values are HTTP and HTTPS. Default value is HTTP. When using HTTPS the HTTP communication is going to be secured using TLS / SSL. If HTTPS was configured as protocol then the user needs to configure at least the keystore in the tls:context child element of this listener-config.

HTTP

 

Host

String

Host where the requests will be sent.

x 

Port

Number

Port where the requests will be received.

x 

Use Persistent Connections

Boolean

If false, each connection will be closed after the first request is completed.

true

 

Connection Idle Timeout

Number

The number of milliseconds that a connection can remain idle before it is closed. The value of this attribute is only used when persistent connections are enabled.

30000

 

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment will fail if the test doesn't pass after exhausting the associated reconnection strategy

 

Associated Sources


Request Config

Configuration element for a HTTP requests.

Parameters

Name Type Description Default Value Required

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x 

Connection

The connection types that can be provided to this configuration.

x 

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before the runtime considers it eligible for expiration. This does not mean that the platform will expire the instance at the exact moment that it becomes eligible. The runtime will actually purge the instances when it sees it fit.

 

Base Path

String

Base path to use for all requests that reference this config.

/

 

Follow Redirects

Boolean

Specifies whether to follow redirects or not. Default value is true.

true

 

Send Body Mode

Enumeration, one of:

  • ALWAYS

  • AUTO

  • NEVER

Defines if the request should contain a body or not. If AUTO, it will depend on the method (GET, HEAD and OPTIONS will not send a body).

AUTO

 

Request Streaming Mode

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

Defines if the request should be sent using streaming or not. If this attribute is not present, the behavior will depend on the type of the payload (it will stream only for InputStream). If set to true, it will always stream. If set to false, it will never stream. As streaming is done the request will be sent user Transfer-Encoding: chunked.

AUTO

 

Enable Cookies

Boolean

If true, cookies received in HTTP responses will be stored, and sent in subsequent HTTP requests.

true

 

Response Timeout

Number

Maximum time that the request element will block the execution of the flow waiting for the HTTP response. If this value is not present, the default response timeout from the Mule configuration will be used.

 

Connection Types

Request

Connection provider for a HTTP request, handles the creation of HttpExtensionClient instances.

Parameters
Name Type Description Default Value Required

Proxy Config

One of:

Reusable configuration element for outbound connections through a proxy. A proxy element must define a host name and a port attributes, and optionally can define a username and a password.

 

Authentication

Authentication method to use for the HTTP request.

 

TLS Configuration

Tls

Reference to a TLS config element. This will enable HTTPS for this config.

 

Protocol

Enumeration, one of:

  • HTTP

  • HTTPS

Protocol to use for communication. Valid values are HTTP and HTTPS. Default value is HTTP. When using HTTPS the HTTP communication is going to be secured using TLS / SSL. If HTTPS was configured as protocol then the user can customize the tls/ssl configuration by defining the tls:context child element of this listener-config. If not tls:context is defined then the default JVM certificates are going to be used to establish communication.

HTTP

 

Host

String

Host where the requests will be sent.

 

Port

Number

Port where the requests will be sent. If the protocol attribute is HTTP (default) then the default value is 80, if the protocol attribute is HTTPS then the default value is 443.

 

Use Persistent Connections

Boolean

If false, each connection will be closed after the first request is completed.

true

 

Max Connections

Number

The maximum number of outbound connections that will be kept open at the same time. By default the number of connections is unlimited.

-1

 

Connection Idle Timeout

Number

The number of milliseconds that a connection can remain idle before it is closed. The value of this attribute is only used when persistent connections are enabled.

30000

 

Response Buffer Size

Number

The space in bytes for the buffer where the HTTP response will be stored as it arrives.

-1

 

Client Socket Properties

 

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment will fail if the test doesn't pass after exhausting the associated reconnection strategy

 

Associated Operations

Operations

Request

<http:request>

Consumes an HTTP service.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Method

String

The HTTP method for the request.

GET

 

Output Mime Type

String

The mime type of the payload that this operation outputs.

 

Output Encoding

String

The encoding of the payload that this operation outputs.

 

Streaming Strategy

Configure if repeatable streams should be used and their behavior

 

Path

String

Path where the request will be sent.

 

URL

String

URL where to send the request.

 

Follow Redirects

Boolean

Specifies whether to follow redirects or not.

 

Send Body Mode

Enumeration, one of:

  • ALWAYS

  • AUTO

  • NEVER

Defines if the request should contain a body or not.

 

Request Streaming Mode

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

Defines if the request should be sent using streaming or not.

 

Response Timeout

Number

Maximum time that the request element will block the execution of the flow waiting for the HTTP response.

 

Body

Any

The body of the response message

#[payload]

 

Headers

Object

HTTP headers the message should include.

 

URI Parameters

Object

URI parameters that should be used to create the request.

 

Query Parameters

Object

Query parameters the request should include.

 

Response Validator

Configures error handling of the response.

 

Target Variable

String

The name of a variable on which the operation's output will be placed

 

Target Value

String

An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable

#[payload]

 

Reconnection Strategy

A retry strategy in case of connectivity errors

 

Output

Type

Binary

Attributes Type

For Configurations.

Throws

  • HTTP:BAD_REQUEST  

  • HTTP:INTERNAL_SERVER_ERROR  

  • HTTP:CLIENT_SECURITY  

  • HTTP:TOO_MANY_REQUESTS  

  • HTTP:UNSUPPORTED_MEDIA_TYPE  

  • HTTP:CONNECTIVITY  

  • HTTP:NOT_ACCEPTABLE  

  • HTTP:TIMEOUT  

  • HTTP:UNAUTHORIZED  

  • HTTP:METHOD_NOT_ALLOWED  

  • HTTP:RETRY_EXHAUSTED  

  • HTTP:FORBIDDEN  

  • HTTP:PARSING  

  • HTTP:SECURITY  

  • HTTP:NOT_FOUND  

  • HTTP:SERVICE_UNAVAILABLE  

Basic Security Filter

<http:basic-security-filter>

Authenticates received HTTP requests. Must be used after a listener component.

Parameters

Name Type Description Default Value Required

Realm

String

Authentication realm.

x 

Security Providers

Array of String

The delegate-security-provider to use for authenticating. Use this in case you have multiple security managers defined in your configuration.

 

Attributes

The HttpRequestAttributes coming from an HTTP listener source to check the 'Authorization' header.

#[attributes]

 

Throws

  • HTTP:BASIC_AUTHENTICATION  

  • MULE:SERVER_SECURITY  

Load Static Resource

<http:load-static-resource>

Serves up static content for use with HTTP, using the request path to lookup the resource.

Parameters

Name Type Description Default Value Required

Resource Base Path

String

The resource base from where documents are served up. For example: /Users/maxthemule/resources

x 

Default File

String

The default file to serve when a directory is specified. The default value is 'index.html'.

index.html

 

Attributes

The HttpRequestAttributes coming from an HTTP listener source to check the required resources.

#[attributes]

 

Target Variable

String

The name of a variable on which the operation's output will be placed

 

Target Value

String

An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable

#[payload]

 

Output

Type

Any

Throws

  • HTTP:NOT_FOUND  

Sources

Listener

<http:listener>

Represents a listener for HTTP requests.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Path

String

Relative path from the path set in the HTTP Listener configuration

x 

Allowed Methods

String

Comma separated list of allowed HTTP methods by this listener. To allow all methods do not defined the attribute.

 

Response Streaming Mode

Enumeration, one of:

  • AUTO

  • ALWAYS

  • NEVER

Defines if the response should be sent using streaming or not. If this attribute is not present, the behavior will depend on the type of the payload (it will stream only for InputStream). If set to true, it will always stream. If set to false, it will never stream. As streaming is done the response will be sent user Transfer-Encoding: chunked.

AUTO

 

Output Mime Type

String

The mime type of the payload that this operation outputs.

 

Output Encoding

String

The encoding of the payload that this operation outputs.

 

Redelivery Policy

Defines a policy for processing the redelivery of the same message

 

Streaming Strategy

Configure if repeatable streams should be used and their behavior

 

Reconnection Strategy

A retry strategy in case of connectivity errors

 

Body

Any

#[payload]

 

Headers

Object

 

Status Code

Number

 

Reason Phrase

String

 

Output

Type

Binary

Attributes Type

For Configurations.

Types

Tls

Field Type Description Default Value Required

Enabled Protocols

String

A comma separated list of protocols enabled for this context.

Enabled Cipher Suites

String

A comma separated list of cipher suites enabled for this context.

Trust Store

Key Store

Trust Store

Field Type Description Default Value Required

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the trust store.

Password

String

The password used to protect the trust store.

Type

String

The type of store used.

Algorithm

String

The algorithm used by the trust store.

Insecure

Boolean

If true, no certificate validations will be performed, rendering connections vulnerable to attacks. Use at your own risk.

Key Store

Field Type Description Default Value Required

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the key store.

Type

String

The type of store used.

Alias

String

When the key store contains many private keys, this attribute indicates the alias of the key that should be used. If not defined, the first key in the file will be used by default.

Key Password

String

The password used to protect the private key.

Password

String

The password used to protect the key store.

Algorithm

String

The algorithm used by the key store.

Reconnection

Field Type Description Default Value Required

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment will fail if the test doesn’t pass after exhausting the associated reconnection strategy

Reconnection Strategy

The reconnection strategy to use

Reconnect

Field Type Description Default Value Required

Frequency

Number

How often (in ms) to reconnect

Count

Number

How many reconnection attempts to make

Reconnect Forever

Field Type Description Default Value Required

Frequency

Number

How often (in ms) to reconnect

Cors Interceptor Wrapper

Field Type Description Default Value Required

Cors Interceptor

x

Cors Listener Interceptor

Field Type Description Default Value Required

Allow Credentials

Boolean

false

Origins

Array of One of:

x

Http Request Attributes

Field Type Description Default Value Required

Client Certificate

Any

Headers

Object

Listener Path

String

Method

String

Query Params

Object

Query String

String

Relative Path

String

Remote Address

String

Request Path

String

Request Uri

String

Scheme

String

Uri Params

Object

Version

String

Redelivery Policy

Field Type Description Default Value Required

Max Redelivery Count

Number

The maximum number of times a message can be redelivered and processed unsuccessfully before triggering process-failed-message

Use Secure Hash

Boolean

Whether to use a secure hash algorithm to identify a redelivered message

Message Digest Algorithm

String

The secure hashing algorithm to use. If not set, the default is SHA-256.

Id Expression

String

Defines one or more expressions to use to determine when a message has been redelivered. This property may only be set if useSecureHash is false.

Object Store

The object store where the redelivery counter for each message is going to be stored.

Repeatable In Memory Stream

Field Type Description Default Value Required

Initial Buffer Size

Number

This is the amount of memory that will be allocated in order to consume the stream and provide random access to it. If the stream contains more data than can be fit into this buffer, then it will be expanded by according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize.

Buffer Size Increment

Number

This is by how much will be buffer size by expanded if it exceeds its initial size. Setting a value of zero or lower will mean that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised when the buffer gets full.

Max Buffer Size

Number

This is the maximum amount of memory that will be used. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised. A value lower or equal to zero means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which all these attributes are expressed

Repeatable File Store Stream

Field Type Description Default Value Required

Max In Memory Size

Number

Defines the maximum memory that the stream should use to keep data in memory. If more than that is consumed then it will start to buffer the content on disk.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which maxInMemorySize is expressed

Tcp Client Socket Properties

Field Type Description Default Value Required

Connection Timeout

Number

30000

Send Tcp No Delay

Boolean

true

Linger

Number

Keep Alive

Boolean

false

Fail On Unresolved Host

Boolean

true

Send Buffer Size

Number

Receive Buffer Size

Number

Client Timeout

Number

Reuse Address

Boolean

true

Expiration Policy

Field Type Description Default Value Required

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A time unit that qualifies the maxIdleTime attribute

Http Response Attributes

Field Type Description Default Value Required

Headers

Object

Reason Phrase

String

Status Code

Number

Basic Authentication

Field Type Description Default Value Required

Username

String

x

Password

String

x

Preemptive

Boolean

true

Digest Authentication

Field Type Description Default Value Required

Username

String

x

Password

String

x

Preemptive

Boolean

true

Ntlm Authentication

Field Type Description Default Value Required

Domain

String

Workstation

String

Username

String

x

Password

String

x

Preemptive

Boolean

true

Proxy

Field Type Description Default Value Required

Host

String

x

Port

Number

x

Username

String

Password

String

Non Proxy Hosts

String

Ntlm Proxy

Field Type Description Default Value Required

Ntlm Domain

String

x

Host

String

x

Port

Number

x

Username

String

Password

String

Non Proxy Hosts

String

Success Status Code Validator

Field Type Description Default Value Required

Values

String

x

Failure Status Code Validator

Field Type Description Default Value Required

Values

String

x

Origin

Field Type Description Default Value Required

Url

String

x

Access Control Max Age

Number

x

Allowed Methods

Array of Method

Allowed Headers

Array of Header

Expose Headers

Array of Header

Method

Field Type Description Default Value Required

Method Name

String

x

Field Type Description Default Value Required

Header Name

String

x