This is the main class of the CoAP connector, is the entry point from which configurations, connection providers, operations and sources are going to be declared.

Configurations


Client

The Client is used to send requests to resources on CoAP servers and/or to observe these. The CoAP server address (host, port) configured here is default for the requests using this client. The request can override if necessary.

Parameters

Name Type Description Default Value Required

Name

String

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

x 

Endpoint

Endpoint configuration to use for the client.

 

Host

String

The default hostname or ip of the server to address. Can be overridden by the host setting on operations.

 

Port

Number

The default port the server is listening on. Can be overridden by the port setting on the operation.

 

Associated Operations

Associated Sources


Server

The Server is used to receive requests on resources from CoAP clients. The configuration is static, which means Mule will create one instance per configuration.

Parameters

Name Type Description Default Value Required

Name

String

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

x 

Endpoint

 

Endpoint1

 

Endpoint2

 

Root Resource

Resources of the server.

x 

Protocol Stage Thread Count

Number

Thread pool size of endpoint executor. Default value is equal to the number of cores.

 

Associated Sources

Operations

Async Request

<coap:async-request>

The Async Request Processor issues a request on a CoAP server. The processor is asynchronous, meaning that it will not block. The response will be processed by specified response handler.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Response Handler

String

Name of the handler that will receive the response.

x 

Request Payload

Binary

The payload of the request.

 

Request Code

Enumeration, one of:

  • GET

  • POST

  • PUT

  • DELETE

The CoAP request code specifying the requested action on the resource on the server.

x 

Confirmable

Boolean

When true the server is expected to acknowledge reception of the request.

true

 

Host

String

The hostname or ip of the server to address. This overrides client host configuration.

 

Port

Number

The port the server is listening on. This overrides client port configuration.

 

Path

String

The path of the resource.

x 

Query Parameters

Array of String

The query parameters to send with the request.

 

Options

Object

The CoAP options to send with the request.

 

For Configurations.

Throws

  • COAP:EXCHANGE_ERROR  

  • COAP:MALFORMED_URI  

  • COAP:INVALID_OPTION_VALUE  

  • COAP:ENDPOINT_ERROR  

  • COAP:INVALID_HANDLER_NAME  

  • COAP:INVALID_REQUEST_CODE  

Discover

<coap:discover>

The Discover processor retrieves information about CoAP resources of a server.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Confirmable

Boolean

When true the server is expected to acknowledge reception of the request.

true

 

Host

String

The hostname or ip of the server to address. This overrides client host configuration.

 

Port

Number

The port the server is listening on. This overrides client port configuration.

 

Query Parameters

Array of String

The query parameters to send with the request.

 

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

For Configurations.

Throws

  • COAP:EXCHANGE_ERROR  

  • COAP:MALFORMED_URI  

  • COAP:ENDPOINT_ERROR  

List Observers

<coap:list-observers>

The List observers processor returns a list containing the uri's of all active observers of the CoAP client.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

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

Array of String

For Configurations.

Ping

<coap:ping>

The Ping processor checks whether a CoAP server is reachable.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Host

String

The hostname or ip of the server to address. This overrides client host configuration.

 

Port

Number

The port the server is listening on. This overrides client port configuration.

 

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

Boolean

For Configurations.

Throws

  • COAP:MALFORMED_URI  

Request

<coap:request>

The Request Processor issues a request on a CoAP server. The processor blocks until a response is received or a timeout occurs.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Request Payload

Binary

The payload of the request

 

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.

 

Request Code

Enumeration, one of:

  • GET

  • POST

  • PUT

  • DELETE

The CoAP request code specifying the requested action on the resource on the server.

x 

Confirmable

Boolean

When true the server is expected to acknowledge reception of the request.

true

 

Host

String

The hostname or ip of the server to address. This overrides client host configuration.

 

Port

Number

The port the server is listening on. This overrides client port configuration.

 

Path

String

The path of the resource.

x 

Query Parameters

Array of String

The query parameters to send with the request.

 

Options

Object

The CoAP options to send with the request.

 

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

Binary

Attributes Type

For Configurations.

Throws

  • COAP:EXCHANGE_ERROR  

  • COAP:MALFORMED_URI  

  • COAP:INVALID_OPTION_VALUE  

  • COAP:ENDPOINT_ERROR  

  • COAP:INVALID_REQUEST_CODE  

Start Observer

<coap:start-observer>

The Start Observer processor creates an observer on the CoAP client. It starts observing the specified server resource immediately.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Handler Name

String

Name of the response handler that will process the notification received from server.

x 

Confirmable

Boolean

When true the server is expected to acknowledge reception of the request.

true

 

Host

String

The hostname or ip of the server to address. This overrides client host configuration.

 

Port

Number

The port the server is listening on. This overrides client port configuration.

 

Path

String

The path of the resource.

x 

Query Parameters

Array of String

The query parameters to send with the request.

 

Options

Object

The CoAP options to send with the request.

 

For Configurations.

Throws

  • COAP:MALFORMED_URI  

  • COAP:INVALID_OBSERVER  

  • COAP:INVALID_HANDLER_NAME  

Stop Observer

<coap:stop-observer>

Stop a running observer.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Confirmable

Boolean

When true the server is expected to acknowledge reception of the request.

true

 

Host

String

The hostname or ip of the server to address. This overrides client host configuration.

 

Port

Number

The port the server is listening on. This overrides client port configuration.

 

Path

String

The path of the resource.

x 

Query Parameters

Array of String

The query parameters to send with the request.

 

Options

Object

The CoAP options to send with the request.

 

For Configurations.

Throws

  • COAP:MALFORMED_URI  

  • COAP:INVALID_OBSERVER  

List Resources

<coap:list-resources>

The List Resources processor returns a list of uri's of the resources of the CoAP server that match given uri pattern.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Uri Pattern

String

The uri pattern of the resource(s) to be found. A wildcard can be used, e.g. "/tobefound/*".

x 

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

Array of String

For Configurations.

Throws

  • COAP:INVALID_RESOURCE_URI  

Resource Exists

<coap:resource-exists>

The Resource Exists processor checks whether the CoAP server has one or more resources matching given uri pattern.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Uri Pattern

String

The uri pattern of the resource(s) to be found. A wildcard can be used, e.g. "/tobefound/*".

x 

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

Boolean

For Configurations.

Throws

  • COAP:INVALID_RESOURCE_URI  

Add Resource

<coap:add-resource>

The Add Resource processor dynamically adds a new resource to the CoAP server. The uri needs to be a complete resource-path, including all parent resource(s). All parent resources in the path must exist already. The resource is available to clients immediately, provided there is a listener configured which has an uri pattern that applies to it.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Uri

String

The uri of the resource to add.

x 

Get

Boolean

When true the resource accepts get-requests.

false

 

Put

Boolean

When true the resource accepts put-requests.

false

 

Post

Boolean

When true the resource accepts post-requests.

false

 

Delete

Boolean

When true the resource accepts delete-requests.

false

 

Observable

Boolean

When true the resource accepts observe-requests.

false

 

Early Ack

Boolean

When true an immediate acknowledgement is sent to the client before processing the request and returning response.

false

 

Info

Meta-information of the resource.

 

For Configurations.

Throws

  • COAP:INVALID_RESOURCE_URI  

Remove Resource

<coap:remove-resource>

The Remove Resource processor removes resources from the CoAP server. All resources that apply to the uri pattern will be removed. Clients that observe a removed resource will be notified.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Uri Pattern

String

The uri pattern of the resource(s) that will be deleted. Wildcards can be used, like "/*" or "/some/deeper/resources/*".

x 

For Configurations.

Throws

  • COAP:INVALID_RESOURCE_URI  

Resource Changed

<coap:resource-changed>

The Resource Changed processor is used to indicates that resources content has changed. It initiates notifications to observing clients. For every observing client and resource an internal get-request is issued on the listener of the resource concerned. The listener flow then processes the get and responses will be sent to the observing client. As a result every client will be notified of the changed resource content.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Uri Pattern

String

The uri pattern specifies the resource(s) that have changed. Wildcards can be used, like "/*" or "/some/deeper/resources/*".

x 

For Configurations.

Throws

  • COAP:INVALID_RESOURCE_URI  

Sources

Response Handler

<coap:response-handler>

The Response Handler message source receives responses on asynchronous CoAP client requests and observe notifications. The CoAP messages received are delivered to the flow.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Handler Name

String

x 

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.

 

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when runnning in Cluster

 

Redelivery Policy

Defines a policy for processing the redelivery of the same message

 

Output

Type

Binary

Attributes Type

For Configurations.

Observer

<coap:observer>

The Observer message source observes a CoAP resource on a server. The CoAP notifications received from the server are delivered to the flow. The resource is observed during runtime of the flow. When an observe relation with the server could not be established or is lost, the flow is notified of the error and the observe request is retried continuously.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Observer Name

String

The name of the observer instance.

x 

Confirmable

Boolean

When true the server is expected to acknowledge reception of the observe request.

true

 

Host

String

The hostname or ip of the server to observe. This overrides client host configuration.

 

Port

Number

The port the server is listening on. This overrides client port configuration.

 

Path

String

The path on the server of the resource to observe.

x 

Query Parameters

Array of String

The query parameters to send with the observe request.

 

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.

 

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when runnning in Cluster

 

Redelivery Policy

Defines a policy for processing the redelivery of the same message

 

Output

Type

Binary

Attributes Type

For Configurations.

Listener

<coap:listener>

The Listener message source receives requests on resources of the CoAP server. The requests on the resources that apply to the resource uri-pattern given, will be listened. When multiple listeners apply the listener with the most specific uri-pattern will process the requests and deliver it to the flow.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Uri Pattern

String

The uriPattern defines the resources the listener listens on. The listener will get requests to process for a resource when it has the most specific pattern that complies to the resources path.

/*

 

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.

 

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when runnning in Cluster

 

Redelivery Policy

Defines a policy for processing the redelivery of the same message

 

Response Body

Binary

#[payload]

 

Response

x 

Output

Type

Binary

Attributes Type

For Configurations.

Types

Socket Params

Field Type Description Default Value Required

Bind To Host

String

Bind To Port

Number

Exchange Params

Field Type Description Default Value Required

Max Active Peers

Number

150000

Max Peer Inactivity Period

Number

600

Ack Timeout

Number

2000

Ack Random Factor

Number

1.5

Ack Timeout Scale

Number

2.0

Max Retransmit

Number

4

Exchange Lifetime

Number

247000

Non Lifetime

Number

145000

Nstart

Number

1

Use Random Mid Start

Boolean

true

Mid Tracker

Token Size Limit

Number

8

Deduplicator

Is It Used

x

Is It Used

Field Type Description Default Value Required

Max Transmit Wait

Number

93000

Leisure

Number

5000

Probing Rate

Number

Blockwise Params

Field Type Description Default Value Required

Preferred Block Size

Number

512

Max Message Size

Number

1024

Max Resource Body Size

Number

8192

Blockwise Status Lifetime

Number

300000

Notification Params

Field Type Description Default Value Required

Notification Check Interval Time

Number

86400000

Notification Check Interval Count

Number

100

Notification Reregistration Backoff

Number

2000

Log Health Status

Field Type Description Default Value Required

Health Status Interval

Number

600

Received Response Attributes

Field Type Description Default Value Required

Confirmable

Boolean

Local Address

String

Notification

Boolean

Options

Object

Relation

String

Remote Address

String

Remote Port

Number

Request Code

String

Request Uri

String

Response Code

String

Success

Boolean

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.

Discovered Resource

Field Type Description Default Value Required

Ct

String

If

String

Obs

Boolean

Rt

String

Sz

String

Title

String

Uri

String

Contained Resources

Field Type Description Default Value Required

Sub Resources

Array of Resource

A set of resources that are contained by a server or parent resource"

Resource

Field Type Description Default Value Required

Resource Name

String

x

Get

Boolean

false

Post

Boolean

false

Put

Boolean

false

Delete

Boolean

false

Observable

Boolean

false

Early Ack

Boolean

false

Info

Contained Resources

x

Resource Info

Field Type Description Default Value Required

Title

String

Human readable title of the resource.

If

String

Comma separated list of interface descriptions that apply to the resource.

Rt

String

Comma separated list of resource types that apply to the resource.

Sz

String

Maximum size estimate of the resource. [bytes]

Ct

String

Comma separated list of content types that are available on the resource. The types are specified by an integer as defined by CoAP.

Received Request Attributes

Field Type Description Default Value Required

Confirmable

Boolean

Local Address

String

Options

Object

Relation

String

Remote Address

String

Remote Port

Number

Request Code

String

Request Uri

String

Response Attributes

Field Type Description Default Value Required

Response Code

Enumeration, one of:

  • CONTENT

  • CREATED

  • CHANGED

  • DELETED

  • VALID

  • CONTINUE

  • BAD_REQUEST

  • UNAUTHORIZED

  • BAD_OPTION

  • FORBIDDEN

  • NOT_FOUND

  • METHOD_NOT_ALLOWED

  • NOT_ACCEPTABLE

  • REQUEST_ENTITY_INCOMPLETE

  • CONFLICT

  • PRECONDITION_FAILED

  • REQUEST_ENTITY_TOO_LARGE

  • UNSUPPORTED_CONTENT_FORMAT

  • UNPROCESSABLE_ENTITY

  • INTERNAL_SERVER_ERROR

  • NOT_IMPLEMENTED

  • BAD_GATEWAY

  • SERVICE_UNAVAILABLE

  • GATEWAY_TIMEOUT

  • PROXY_NOT_SUPPORTED

  • TOO_MANY_REQUESTS

The CoAP response code to be set in the CoAP response.

Options

Object

The CoAP options to be set in the CoAP response.

UDP Endpoint

Field Type Description Default Value Required

Udp Params

UDP endpoint parameters.

Socket Params

The socketParams to use

Exchange Params

The coap exchange parameters.

Blockwise Params

The parameters for blockwise transfer.

Notification Params

The parameters for notification.

Congestion Control

Configuration of the congestion control algorithm, if any.

Log Health Status

When activated logHealthStatus is periodically logged.

Log Coap Messages

Boolean

When activated incoming and outgoing CoAP messages are logged.

false

Udp Params

Field Type Description Default Value Required

Network Stage Receiver Thread Count

Number

Network Stage Sender Thread Count

Number

Udp Connector Datagram Size

Number

2048

Udp Connector Receive Buffer

Number

Udp Connector Send Buffer

Number

Udp Connector Out Capacity

Number

Multicast UDP Endpoint

Field Type Description Default Value Required

Multicast Params

Parameters for receiving multi-cast messages. None will be received when no multi-cast groups are configured.

x

Udp Params

UDP endpoint parameters.

Socket Params

The socketParams to use

Exchange Params

The coap exchange parameters.

Blockwise Params

The parameters for blockwise transfer.

Notification Params

The parameters for notification.

Congestion Control

Configuration of the congestion control algorithm, if any.

Log Health Status

When activated logHealthStatus is periodically logged.

Log Coap Messages

Boolean

When activated incoming and outgoing CoAP messages are logged.

false

Multicast Params

Field Type Description Default Value Required

Interface Address

String

Multicast Groups

Array of String

DTLS Endpoint

Field Type Description Default Value Required

Dtls Params

DTLS auto resumption timeout in milliseconds [ms]. After that period without exchanged messages, the session is forced to resume.

Encryption Params

The encryption parameters.

x

Udp Params

UDP endpoint parameters.

Socket Params

The socketParams to use

Exchange Params

The coap exchange parameters.

Blockwise Params

The parameters for blockwise transfer.

Notification Params

The parameters for notification.

Congestion Control

Configuration of the congestion control algorithm, if any.

Log Health Status

When activated logHealthStatus is periodically logged.

Log Coap Messages

Boolean

When activated incoming and outgoing CoAP messages are logged.

false

Dtls Params

Field Type Description Default Value Required

Response Matching

Enumeration, one of:

  • STRICT

  • RELAXED

  • PRINCIPAL

Dtls Auto Resume Timeout

Number

30000

Secure Session Timeout

Number

86400

Encryption Params

Field Type Description Default Value Required

Key Store Location

String

x

Key Store Password

String

x

Private Key Alias

String

x

Private Key Password

String

x

Trust Store Location

String

x

Trust Store Password

String

x

Trusted Root Certificate Alias

String

x

Tcp Server Endpoint

Field Type Description Default Value Required

Tcp Params

The tcpParams to use.

Socket Params

The socketParams to use

Exchange Params

The coap exchange parameters.

Blockwise Params

The parameters for blockwise transfer.

Notification Params

The parameters for notification.

Congestion Control

Configuration of the congestion control algorithm, if any.

Log Health Status

When activated logHealthStatus is periodically logged.

Log Coap Messages

Boolean

When activated incoming and outgoing CoAP messages are logged.

false

Tcp Params

Field Type Description Default Value Required

Tcp Worker Threads

Number

1

Tcp Connect Timeout

Number

10000

Tcp Connection Idle Timeout

Number

10

Tcp Client Endpoint

Field Type Description Default Value Required

Tcp Params

The tcpParams to use.

Socket Params

The socketParams to use

Exchange Params

The coap exchange parameters.

Blockwise Params

The parameters for blockwise transfer.

Notification Params

The parameters for notification.

Congestion Control

Configuration of the congestion control algorithm, if any.

Log Health Status

When activated logHealthStatus is periodically logged.

Log Coap Messages

Boolean

When activated incoming and outgoing CoAP messages are logged.

false

Tls Server Endpoint

Field Type Description Default Value Required

Tls Params

The TLS parameters.

Encryption Params

The encryption parameters.

x

Tcp Params

The tcpParams to use.

Socket Params

The socketParams to use

Exchange Params

The coap exchange parameters.

Blockwise Params

The parameters for blockwise transfer.

Notification Params

The parameters for notification.

Congestion Control

Configuration of the congestion control algorithm, if any.

Log Health Status

When activated logHealthStatus is periodically logged.

Log Coap Messages

Boolean

When activated incoming and outgoing CoAP messages are logged.

false

Tls Params

Field Type Description Default Value Required

Tls Handshake Timeout

Number

10000

Secure Session Timeout

Number

86400

Tls Client Endpoint

Field Type Description Default Value Required

Tls Params

The TLS parameters.

Encryption Params

The encryption parameters.

x

Tcp Params

The tcpParams to use.

Socket Params

The socketParams to use

Exchange Params

The coap exchange parameters.

Blockwise Params

The parameters for blockwise transfer.

Notification Params

The parameters for notification.

Congestion Control

Configuration of the congestion control algorithm, if any.

Log Health Status

When activated logHealthStatus is periodically logged.

Log Coap Messages

Boolean

When activated incoming and outgoing CoAP messages are logged.

false

Grouped Mid Tracker

Field Type Description Default Value Required

Mid Tracker Groups

Number

The default number of MID groups. Used for GROUPED message Id tracker.

16

Crop Rotation

Field Type Description Default Value Required

Crop Rotation Period

Number

The period of CROP_ROTATION deduplicators cleanup cycle in milliseconds [ms].

247000

Mark And Sweep

Field Type Description Default Value Required

Mark And Sweep Interval

Number

The period of MARK_AND_SWEEP deduplicators cleanup cycle in milliseconds [ms].

10000