Contact Us 1-800-596-4880

APIkit for AsyncAPI Module Reference

Open Beta Release: Any use of APIkit for AsyncAPI in its beta state is subject to the applicable beta services terms and conditions.

To collaborate, build applications, and maintain codebases, learn the fundamentals of dependency, namespace, and schema information in APIkit for AsyncAPI.

Dependencies

<dependency>
  <groupId>org.mule.modules</groupId>
  <artifactId>mule-asynckit-module</artifactId>
  <version>LATEST_VERSION</version> (1)
  <classifier>mule-plugin</classifier>
</dependency>
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

Name

String

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

None

Yes

Api Definition

String

API definition.

None

Yes

Kafka Configs

Array of Kafka Config.

None

No

Anypoint MQ Configs

Array of Anypoint MQ Config.

None

No

Name

String

Identifier of this element used to reference it in other components.

None

Yes

Supported Message Brokers

Feature Description Supported Protocols Configuration Details

Anypoint MQ Message Broker

Supports asynchronous messaging with Anypoint MQ.

anypointmq

Anypoint MQ configurations are specified in the server object of the AsyncAPI specification. Supports both Publish and Subscribe operations.

Kafka Message Broker

Supports asynchronous messaging with Apache Kafka.

kafka, kafka-secure

Kafka configurations are specified in the server object of the AsyncAPI specification. Supports both Publish and Subscribe operations.

Associated Operations

Associated Sources

Operations

Publish

<apikit-asyncapi:publish>

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use

None

Yes

Content

Binary

None

#[payload]

No

Config Ref

ConfigurationProvider

Name of the configuration used to execute this component

None

Yes

Channel Name

String

Channel name

None

Yes

Server Name

String

Server name

None

Yes

Target Variable

String

Name of a variable on which the operation’s output is placed

None

No

Target Value

String

Expression that is evaluated against the operation’s output and the result of that expression is stored in the target variable

#[payload]

No

Error Mappings

Array of Error Mapping

Set of error mappings

None

No

Output

Type

PublishResponse

For Configurations

Throws

  • APIKIT-ASYNCAPI:INTERNAL_SERVER_ERROR

  • APIKIT-ASYNCAPI:PUBLISHING_ERROR

  • APIKIT-ASYNCAPI:VALIDATION_ERROR

Sources

Message Listener

<apikit-asyncapi:message-listener>

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use

None

Yes

Channel Name

String

Channel name

None

Yes

Servers

Array of String

List of servers to listen to

None

No

Output MIME Type

String

MIME type of the payload that this operation generates

None

No

Output Encoding

String

Encoding of the payload that this operation generates

None

No

Primary Node Only

Boolean

Specifies if this source must be executed on the primary node when running in a cluster

None

No

Config Ref

ConfigurationProvider

Name of the configuration used to execute this component

None

Yes

Streaming Strategy

Specify and configure repeatable streams

None

No

Redelivery Policy

Redelivery Policy

Policy for processing the redelivery of the same message

None

No

Output

Type

Any

Attributes Type

For Configurations

Types

Kafka Config

Field Type Description Default Value Required

Server Key

String

Identifier for the server configuration within the AsyncAPI configuration

None

Yes

Producer Config Ref

String

Reference to the Kafka Producer configuration

None

No

Consumer Config Ref

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

Server Key

String

Identifier for the server configuration in AsyncAPI

None

Yes

Config Ref

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.

Repeatable In Memory Stream

Field Type Description Default Value Required

Initial Buffer Size

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 bufferSizeIncrement attribute, with an upper limit of maxInMemorySize.

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 STREAM_MAXIMUM_SIZE_EXCEEDED error occurs.

None

No

Max Buffer Size

Number

The maximum amount of memory used. If more is used, a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower or equal to zero means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

These attributes are expressed in this unit.

None

No

Repeatable File Store Stream

Field Type Description Default Value Required

In Memory Size

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.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit for expressing maxInMemorySiz.

None

No

Redelivery Policy

Field Type Description Default Value Required

Max Redelivery Count

Number

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

None

No

Message Digest Algorithm

String

Secure hashing algorithm

SHA-256

No

Message Identifier

Redelivery Policy Message Identifier

Strategy used to identify the messages

None

No

Object Store

ObjectStore

Object store where the redelivery counter for each message is stored

None

No

Redelivery Policy Message Identifier

Field Type Description Default Value Required

Use Secure Hash

Boolean

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

None

No

Id Expression

String

Expression used to determine if a message has been redelivered. You can set this property if useSecureHash is false.

None

No

Publish Response

Field Type Description Default Value Required

Response Data

Object

Error Mapping

Field Type Description Default Value Required

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Type of error encountered during the operation

None

Yes

Target

String

The specific component or module where the error needs to be addressed

None

Yes

Kafka Message Attributes

Field Type Description Default Value Required

Channel Name

String

The name of the Kafka channel (topic) where the message is published or consumed

None

Yes

Channel Parameters

Object

Additional parameters or settings specific to the channel

None

No

Creation Timestamp

DateTime

The timestamp when the message was created

None

No

Headers

Object

Metadata associated with the message, typically key-value pairs

None

No

Key

String

This key determines the partition within the Kafka topic where the message is sent

None

No

Leader Epoch

Number

The epoch of the leader broker at the time the message is sent

None

No

Log Append Timestamp

DateTime

The timestamp when the message is appended to the log

None

No

Offset

Number

The message offset in the Kafka topic partition

None

No

Partition

Number

The partition within the Kafka topic where the message is stored

None

No

Protocol

String

The protocol the Kafka server uses

None

No

Server Name

String

The name of the Kafka server that processes the message

None

Yes

Anypoint MQ Message Attributes

Field Type Description Default Value Required

Ack Token

String

Token used for acknowledging the receipt of a message

None

No

Channel Name

String

The name of the Anypoint MQ channel where the message is published or consumed

None

Yes

Channel Parameters

Object

Additional parameters or settings specific to the channel

None

No

Content Type

String

The MIME type of the message content

None

No

Delivery Count

Number

The number of times the message is delivered

None

No

Headers

Object

Metadata associated with the message, typically key-value pairs

None

No

Message Id

String

Unique identifier for the message

None

Yes

Properties

Object

Custom properties associated with the message

None

No

Protocol

String

The protocol the Anypoint MQ server uses

None

No

Server Name

String

The name of the Anypoint MQ server that processes the message

None

Yes