<dependency> <groupId>org.mule.modules</groupId> <artifactId>mule-asynckit-module</artifactId> <version>LATEST_VERSION</version> (1) <classifier>mule-plugin</classifier> </dependency>
APIkit for AsyncAPI Module Reference
Integrate AsyncAPI specifications into Mule with the APIkit for AsyncAPI module: add the Maven dependency, declare the module namespace, and apply the XML schema when you configure generated scaffolding. This reference documents coordinates, namespaces, schema locations, and configuration elements you use to implement event-driven APIs.
Dependencies
| 1 | Check the APIkit Release Notes to get the LATEST_VERSION. |
Namespace and Schema
xmlns:apikit-asyncapi="http://www.mulesoft.org/schema/mule/apikit-asyncapi" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/apikit-asyncapi http://www.mulesoft.org/schema/mule/apikit-asyncapi/current/mule-apikit-asyncapi.xsd">
Configurations
Config
Default configuration
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
String |
Name for this configuration. Connectors reference the configuration with this name. |
None |
Yes |
|
String |
API definition. |
None |
Yes |
|
Boolean |
Disable payload content validation. |
|
No |
|
Array of Kafka Config |
List of Kafka server configurations. One for each Kafka server listed in the specification that is scaffolded to create the app. |
None |
No |
|
Array of Anypoint MQ Config |
List of AMQ configurations. |
None |
No |
|
Array of Solace Config |
List of Solace configurations. |
None |
No |
|
Array of Salesforce Pub/Sub Connector Config |
List of SalesforcePubSub configurations. |
None |
No |
|
String |
Identifier of this element used to reference it in other components. |
None |
Yes |
Supported Message Brokers
| Message Broker | Description | Supported Protocols | Configuration Details |
|---|---|---|---|
Anypoint MQ |
Supports asynchronous messaging with Anypoint MQ. |
anypointmq |
Anypoint MQ configurations are specified in the server object of the AsyncAPI specification. Supports Message Listener for consuming messages from channels declared in AsyncAPI |
Kafka |
Supports asynchronous messaging with Apache Kafka. |
kafka, kafka-secure |
Kafka configurations are specified in the server object of the AsyncAPI specification. Supports Message Listener for consuming messages from channels declared in AsyncAPI |
Salesforce platform events |
Allows implementing an Async API specification using Anypoint Connector for Salesforce Pub/Sub (Salesforce Pub/Sub Connector). |
salesforcepubsub* |
Connection details are available in the properties file. Supports Message Listener for In the Message Listener operation, the AsyncAPI spec In the Publish operation, the payload must be JSON. The APIkit for AsyncAPI module transforms the JSON payload to the array-of-objects type. |
Solace Pub/Sub+ |
Supports the implementation of an Async API specification using Solace PubSub+ Connector. |
solace |
Connection details are available in the properties file. Supports Message Listener for |
* You must use Anypoint Connector for Salesforce Pub/Sub Connector 1.0.15 or later.
Configuration Details by Operation
APIkit for AsyncAPI supports two runtime operations in Mule flows: Message Listener and Publish. In AsyncAPI semantics, subscribe channels map to the Message Listener source, and publish channels map to the Publish operation.
Message Listener
Use Message Listener (<apikit-asyncapi:message-listener>) to consume events from AsyncAPI channels, trigger flow execution, and validate incoming payloads against the channel message schema.
These message brokers are available for the Message Listener operation:
-
Anypoint MQ
-
Kafka
-
Salesforce Pub/Sub
-
Solace PubSub+
Configuration Options
Core listener parameters:
| Parameter | Description |
|---|---|
|
Reference to the APIkit for AsyncAPI configuration |
|
AsyncAPI channel to consume |
|
Optional list of server names to listen to |
|
Disables payload validation against the AsyncAPI schema |
|
Optional output format controls |
|
Runs only on the primary node in a cluster |
|
|
|
Redelivery behavior for failed processing |
Broker-specific configuration in Config:
| Broker | Configuration details |
|---|---|
Anypoint MQ |
Configure |
Kafka |
Configure |
Salesforce Pub/Sub |
Configure |
Solace PubSub+ |
Configure |
Publish
Use Publish (<apikit-asyncapi:publish>) to send events to AsyncAPI channels defined for publishing. The operation validates outgoing payloads when validation is enabled.
These message brokers are available for the Publish operation:
-
Salesforce Pub/Sub
-
Solace PubSub+
Configuration Options
Core publish parameters:
| Parameter | Description |
|---|---|
|
Reference to the APIkit for AsyncAPI configuration |
|
AsyncAPI channel to publish to |
|
Server alias from the AsyncAPI spec |
|
Payload to publish ( |
|
Disables payload validation against the AsyncAPI schema |
|
Optional output capture |
|
Optional mapping of operation errors |
Broker-specific configuration in Config:
| Broker | Configuration details |
|---|---|
Salesforce Pub/Sub |
Configure |
Solace PubSub+ |
Configure |
Validation of Messages
Unless explicitly restricted, the JSON schema validation allows omitting and adding fields. Check the message validation against the schema in the following table:
| Schema Definition | Message | Valid |
|---|---|---|
{ A: integer, B: string } |
{A, B} |
Yes |
{ A: integer, B: string } |
{C, D} |
Yes |
{ A: integer, B: string } required [A, B] |
{C, D} |
No |
{ A: integer, B: string } required [A, B] |
{A, B, C} |
Yes |
{ A: integer, B: string } required [A, B] |
{A, B, C} |
No |
{ A: integer, B: string } required [A, B] |
{A, B} |
No |
-
The
requiredfield specifies the list of fields that are mandatory in the JSON object. -
The
additionalPropertiesfield specifies if you can include additional properties to the JSON object.
The schemas must specify required and additionalProperties in the API specification.
| The field value is checked against the type specified in the schema as part of the validation. |
If an operation has multiple message schemas associated in the specification, the validation adheres to these principles:
-
Messages are validated against every schema.
-
If it’s compliant with at least one schema, the message is considered valid.
-
If the message doesn’t adhere to at least one schema, the message is considered invalid.
Example
| Schema Definition | Message | Valid |
|---|---|---|
{ A: integer, B: string } required [A, B] |
{A, B} |
Yes |
{ A: integer, B: string } required [A, B] |
{B, C} |
No |
{ A: integer, B: string } required [A, B] |
{A, B, C} |
No |
{ A: integer, B: string } required [A, B] |
{C, D} |
Yes |
Publish
<apikit-asyncapi:publish>
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
String |
Name of the configuration to use |
None |
Yes |
|
Binary |
The binary content to be processed |
#[payload] |
No |
|
Boolean |
Indicates if validation of the content is disabled |
|
No |
|
ConfigurationProvider |
Name of the configuration used to execute this component |
None |
Yes |
|
String |
Channel name |
None |
Yes |
|
String |
Server name |
None |
Yes |
|
String |
Name of a variable in which the operation output is placed |
None |
No |
|
String |
Expression that is evaluated against the operation output and the result of that expression is stored in the target variable |
#[payload] |
No |
|
Array of Error Mapping |
Set of error mappings |
None |
No |
Message Listener
<apikit-asyncapi:message-listener>
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
String |
Name of the configuration to use |
None |
Yes |
|
Boolean |
Disable payload content validation |
None |
No |
|
String |
Channel name |
None |
Yes |
|
Array of String |
List of servers to listen to |
None |
No |
|
String |
MIME type of the payload that this operation generates |
None |
No |
|
String |
Encoding of the payload that this operation generates |
None |
No |
|
Boolean |
Specifies if this source must be executed on the primary node when running in a cluster |
None |
No |
|
ConfigurationProvider |
Name of the configuration used to execute this component |
None |
Yes |
Streaming Strategy |
|
Specify and configure repeatable streams |
None |
No |
|
Policy for processing the redelivery of the same message |
None |
No |
Output
| Field | Description |
|---|---|
|
Any type |
|
One of: * Kafka Message Attributes * Anypoint MQ Message Attributes * Solace Message Attributes * Salesforce Pub/Sub Attributes |
Types
Kafka Config
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
String |
Identifier for the server configuration within the AsyncAPI configuration |
None |
Yes |
|
String |
Reference to the Kafka Producer configuration |
None |
No |
|
String |
Reference to the Kafka Consumer configuration |
None |
No |
| The Server Key is required to uniquely identify the server configuration. The references for Producer and Consumer configurations are optional and depend on the specific setup and requirements of the Kafka implementation. |
Anypoint MQ Config
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
String |
Identifier for the server configuration in AsyncAPI |
None |
Yes |
|
String |
Reference to the Anypoint MQ configuration details |
None |
No |
| The Server Key is required to uniquely identify the server configuration. Config Ref is optional and used to specify additional configuration details. |
Solace Config
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
String |
Server key set in the AsyncAPI spec |
None |
Yes |
|
String |
Reference to the configuration name of the Solace connection |
None |
No |
| The Server Key is required to uniquely identify the server configuration. Config Ref is optional and used to specify additional configuration details. |
Limitations of Solace PubSub+ Connector
Solace PubSub+ Connector in APIkit for AsyncAPI has these limitations:
-
The Solace PubSub+ Connector supports
queueandtopicfordestinationsin the message listener and publish operations. But the APIkit for AsyncAPI implementation only supports usingqueueas the value ofdestination. -
Only one operator of the same type must be mapped to the same
queueofdestination.
Salesforce Pub/Sub Connector Config
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
String |
Server key set in the AsyncAPI spec |
None |
Yes |
|
String |
Reference to the name of the Salesforce Pub/Sub Connector configuration |
None |
No |
| The Server Key is required to uniquely identify the server configuration. Config Ref is optional and used to specify additional configuration details. |
Repeatable In Memory Stream
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
Number |
Amount of memory allocated to consume the stream and provide random access to it. If the stream data is larger than the buffer capacity, it expands according to the |
None |
No |
Buffer Size Increment |
Number |
How much the buffer size expands if it exceeds its initial size. A value of zero or lower specifies that the buffer doesn’t expand. When the buffer is full, a |
None |
No |
|
Number |
Maximum amount of memory used. If more is used, a |
None |
No |
Buffer Unit |
Enumeration, one of:
|
These attributes are expressed in this unit. |
None |
No |
Repeatable File Store Stream
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
Number |
Defines the maximum memory that the stream uses to keep data in memory. If it consumes more, the stream buffers the content on the disk. |
None |
No |
Buffer Unit |
Enumeration, one of:
|
The unit for expressing |
None |
No |
Redelivery Policy
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
Number |
Maximum number of times a message can be redelivered and processed unsuccessfully before triggering process-failed-message |
None |
No |
|
String |
Secure hashing algorithm |
SHA-256 |
No |
|
Strategy used to identify the messages |
None |
No |
|
|
ObjectStore |
Object store where the redelivery counter for each message is stored |
None |
No |
Redelivery Policy Message Identifier
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
Boolean |
Whether to use a secure hash algorithm to identify a redelivered message. |
None |
No |
|
String |
Expression used to determine if a message has been redelivered. You can set this property if |
None |
No |
Publish Response
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
Object |
Data the server returns in response to a request |
None |
No |
Error Mapping
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
Source |
Enumeration, one of:
|
Type of error encountered during the operation |
None |
Yes |
|
String |
The specific component or module where the error needs to be addressed |
None |
Yes |
Kafka Message Attributes
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
String |
Name of the Kafka channel (topic) where the message is published or consumed |
None |
Yes |
|
Object |
Additional parameters or settings specific to the channel |
None |
No |
|
DateTime |
Timestamp when the message was created |
None |
No |
|
Object |
Metadata associated with the message, typically key-value pairs |
None |
No |
|
String |
This key determines the partition within the Kafka topic where the message is sent |
None |
No |
|
Number |
Epoch of the leader broker at the time the message is sent |
None |
No |
|
DateTime |
Timestamp when the message is appended to the log |
None |
No |
|
Number |
Message offset in the Kafka topic partition |
None |
No |
|
Number |
Partition within the Kafka topic where the message is stored |
None |
No |
|
String |
Protocol the Kafka server uses |
None |
No |
|
String |
Name of the Kafka server that processes the message |
None |
Yes |
Anypoint MQ Message Attributes
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
String |
Token used for acknowledging the receipt of a message |
None |
No |
|
String |
Name of the Anypoint MQ channel where the message is published or consumed |
None |
Yes |
|
Object |
Additional parameters or settings specific to the channel |
None |
No |
|
String |
MIME type of the message content |
None |
No |
|
Number |
Number of times the message is delivered |
None |
No |
|
Object |
Metadata associated with the message, typically key-value pairs |
None |
No |
|
String |
Unique identifier for the message |
None |
Yes |
|
Object |
Custom properties associated with the message |
None |
No |
|
String |
Protocol the Anypoint MQ server uses |
None |
No |
|
String |
Name of the Anypoint MQ server that processes the message |
None |
Yes |
Solace Message Attributes
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
Boolean |
Indicates if the message is eligible for Dead Message Queue |
|
No |
|
String |
Name of the Solace channel where the message is published or consumed |
None |
No |
|
Object |
Additional parameters or settings specific to the Solace channel |
None |
No |
|
String |
MIME type of the message content |
None |
No |
|
String |
Delivery mode of the message |
None |
No |
|
Boolean |
Indicates if the message is discarded |
|
No |
|
Boolean |
Indicates if the message is eligible for eliding |
|
No |
|
String |
Type of endpoint used |
None |
No |
|
String |
Reference identifier for the message |
None |
No |
|
Number |
Priority level of the message |
0 |
No |
|
String |
Protocol the Solace server uses |
None |
No |
|
DateTime |
Timestamp when the message was received |
None |
No |
|
Boolean |
Indicates if the message is redelivered |
|
No |
|
Boolean |
Indicates if the message expects a reply |
|
No |
|
String |
Name of the Solace server that processes the message |
None |
Yes |
|
Number |
Time in milliseconds that the message remains valid |
0 |
No |
Salesforce Pub/Sub Attributes
| Field | Type | Description | Default Value | Required |
|---|---|---|---|---|
|
String |
Name of the Salesforce Pub/Sub channel where the message is published or consumed |
None |
No |
|
Object |
Additional parameters or settings specific to the Salesforce Pub/Sub channel |
None |
No |
|
String |
Protocol the Salesforce Pub/Sub server uses |
None |
No |
|
String |
Name of the Salesforce Pub/Sub server that processes the message |
None |
No |



