Contact Us 1-800-596-4880

Azure Event Hubs Connector Reference 1.0 - Mule 4

Anypoint Connector for Azure Event Hubs (Azure Event Hubs Connector) enables support for event producing and consuming.

Configurations


Azure Event Hubs

This class represents an extension configuration, values set in this class are commonly used across multiple operations since they represent something core from the extension.

Parameters

Name Type Description Default Value Required

Name

String

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

x

Connection

Connection types for this configuration.

x

Name

String

ID used to reference this configuration.

x

Expiration Policy

Configures an expiration policy for the configuration.

Connection Types

Active Directory Authentication

Azure Event Hubs Connector offers two mechanisms to connect to Azure Event Hubs using Active Directory:

  • Connect with Token Credentials Properties (TenantId, ClientId, and ClientSecret) via service principal authentication.

  • Connect using DefaultAzureCredential that belong to Azure.Identity library.

Parameters
Name Type Description Default Value Required

Token Credential Properties

Acquires a token via service principal authentication.

Use Azure Default Credential

Boolean

Use DefaultAzureCredentials mechanism.

false

Namespace

String

Event Hubs namespace name.

x

Authority Host

String

Specifies the Azure active directory host. Defaults to https://login.microsoftonline.com/

Event Hub Name

String

Event Hub name.

x

Share Connection

Boolean

Toggles the builder to use the same connection for producers or consumers.

false

Checkpoint Store Type

Select the checkpointing connection provider.

Reconnection

Configures a reconnection strategy to use when a connector operation fails to connect to an external server.

SAS Authentication

A shared access signature (SAS) enables you to grant limited access to resources in your event hubs namespace. SAS guards access to Event Hubs resources based on authorization rules. Configure these rules either on a namespace or an event hub.

Parameters
Name Type Description Default Value Required

Namespace

String

Event Hubs namespace name.

x

Shared Access Key Name

String

Shared access key name given by Azure.

x

Shared Access Key

String

Shared access key value given by Azure.

x

Event Hub Name

String

Event Hub name.

x

Share Connection

Boolean

Toggles the builder to use the same connection for producers or consumers.

false

Checkpoint Store Type

Select Azure blob storage connection provider.

Reconnection

Configures a reconnection strategy to use when a connector operation fails to connect to an external server.

Supported Operations

Operations

Publish in bulk

<azure-eventhubs:bulk-publish>

Sends an event in bulk to a specified event hub.

Parameters

Name Type Description Default Value Required

Configuration

String

ID used to reference this configuration.

x

Events

Array of Event

The event’s content.

#[payload]

Correlation Id

String

Correlation ID.

Content Type

String

A MIME type describing the data contained in the EventBody, intended to allow consumers to make informed decisions for inspecting and processing the event.

Max Batch Size In Bytes

Number

Allow numbers greater than 24. If not configured, takes the default value configured in the Azure account.

0

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Partition Id

String

Partition ID.

Partition Key

String

Partition key.

Reconnection Strategy

Retry strategy in case of connectivity errors.

For Configurations

Throws

  • AZURE-EVENTHUBS:AEH_ERROR

  • AZURE-EVENTHUBS:AUTHENTICATION

  • AZURE-EVENTHUBS:CONNECTIVITY

  • AZURE-EVENTHUBS:INVALID_INPUT

  • AZURE-EVENTHUBS:RETRY_EXHAUSTED

Send a single event

<azure-eventhubs:publish>

Sends an event to a specified event hub.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Event

The event’s content

#[payload]

Correlation Id

String

Correlation ID.

Content Type

String

A MIME type describing the data contained in the EventBody, intended to allow consumers to make informed decisions for inspecting and processing the event.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Partition Id

String

Partition ID.

Partition Key

String

Partition key.

Reconnection Strategy

Retry strategy in case of connectivity errors.

For Configurations

Throws

  • AZURE-EVENTHUBS:AEH_ERROR

  • AZURE-EVENTHUBS:AUTHENTICATION

  • AZURE-EVENTHUBS:CONNECTIVITY

  • AZURE-EVENTHUBS:INVALID_INPUT

  • AZURE-EVENTHUBS:RETRY_EXHAUSTED

Sources

Partition Listener

<azure-eventhubs:partition-listener>

Reads events from a specific event hub partition in a namespace.

Parameters

Name Type Description Default Value Required

Configuration

String

ID used to reference this configuration.

x

Partition Id

String

Partition ID of the event hub.

x

Consumer Group

String

The consumer group to belong to.

Event Position Type

One of:

Defines the position of an event in an Event Hub partition. The position can be an enqueued time, offset, sequence number, the start of the stream, or the end of the stream.

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.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Primary Node Only

Boolean

Determines whether to execute this source on only the primary node when running Mule instances in a cluster.

true

On Capacity Overload

Enumeration, one of:

  • DROP

  • WAIT

Strategy that Mule applies when the flow receives more messages than it has the capacity to manage.

DROP

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

Reconnection strategy to use.

Output

Type

Any

Attributes Type

For Configurations

Eventhub Listener

<azure-eventhubs:eventhub-listener>

Reads events from an event hub in a namespace.

Parameters

Name Type Description Default Value Required

Configuration

String

ID used to reference this configuration.

x

Consumer Group

String

The consumer group to belong to.

Checkpoint Frequency

Number

Frequency of updating the checkpoint. For instance, every 1000 events received.

Output Mime Type

String

Mime type of the payload that this operation outputs.

Output Encoding

String

Encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Primary Node Only

Boolean

Determines whether to execute this source on only the primary node when running Mule instances in a cluster.

On Capacity Overload

Enumeration, one of:

  • DROP

  • WAIT

Strategy that Mule applies when the flow receives more messages than it has the capacity to manage.

DROP

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

Reconnection strategy to use.

Output

Type

Any

Attributes Type

For Configurations

Types

Token Credential Properties

Field Type Description Default Value Required

Tenant Id

String

Tenant ID.

Client Id

String

Client ID.

Client Secret

String

Client secret.

Reconnection

Configures a reconnection strategy for an operation.

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 fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

Reconnection strategy to use.

Reconnect

Configures a standard reconnection strategy, which specifies how often to reconnect and how many reconnection attempts the connector source or operation can make.

Field Type Description Default Value Required

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

Count

Number

How many reconnection attempts the Mule app can make.

Reconnect Forever

Configures a forever reconnection strategy by which the connector source or operation attempts to reconnect at a specified frequency for as long as the Mule app runs.

Field Type Description Default Value Required

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

Expiration Policy

Configures an expiration policy strategy.

Field Type Description Default Value Required

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

Event Attributes

Field Type Description Default Value Required

Content Type

String

A MIME type describing the data contained in the EventBody, intended to allow consumers to make informed decisions for inspecting and processing the event.

Correlation Id

String

Correlation ID.

Enqueued Time

DateTime

The date and time, in UTC, of when the event was enqueued in the Event Hub partition.

Message Id

String

An application-defined value that uniquely identifies the event. The identifier is a free-form value and can reflect a GUID or an identifier derived from the application context.

Metadata

Object

Custom data added to the Event, it exists only for coordination between event publishers and consumers.

Offset

Number

An offset is the position of an event within a partition.

Sequence Number

Number

The sequence number assigned to the event when it was enqueued in the associated Event Hub partition.

Repeatable In Memory Stream

Configures the in-memory streaming strategy by which the request fails if the data exceeds the MAX buffer size. Always run performance tests to find the optimal buffer size for your specific use case.

Field Type Description Default Value Required

Initial Buffer Size

Number

Initial amount of memory to allocate to the data stream. If the streamed data exceeds this value, the buffer expands by Buffer Size Increment, with an upper limit of Max In Memory Size value.

Buffer Size Increment

Number

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

Max Buffer Size

Number

Maximum size of the buffer. If the buffer size exceeds this value, Mule raises a STREAM_MAXIMUM_SIZE_EXCEEDED error. A value of less than or equal to 0 means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the Initial Buffer Size, Buffer Size Increment, and Buffer Unit fields.

Repeatable File Store Stream

Configures the repeatable file-store streaming strategy by which Mule keeps a portion of the stream content in memory. If the stream content is larger than the configured buffer size, Mule backs up the buffer’s content to disk and then clears the memory.

Field Type Description Default Value Required

In Memory Size

Number

Maximum amount of memory that the stream can use for data. If the amount of memory exceeds this value, Mule buffers the content to disk. To optimize performance:

  • Configure a larger buffer size to avoid the number of times Mule needs to write the buffer on disk. This increases performance, but it also limits the number of concurrent requests your application can process, because it requires additional memory.

  • Configure a smaller buffer size to decrease memory load at the expense of response time.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the In Memory Size field.

Redelivery Policy

Configures the redelivery policy for executing requests that generate errors. You can add a redelivery policy to any source in a flow.

Field Type Description Default Value Required

Max Redelivery Count

Number

Maximum number of times that a redelivered request can be processed unsuccessfully before returning a REDELIVERY_EXHAUSTED error.

Message Digest Algorithm

String

Secure hashing algorithm to use if the Use Secure Hash field is true. If the payload of the message is a Java object, Mule ignores this value and returns the value that the payload’s hashCode() returned.

Message Identifier

One or more expressions that determine if a message was redelivered. This property can be set only if the Use Secure Hash field is false.

Object Store

ObjectStore

Configures the object store that stores the redelivery counter for each message.

Redelivery Policy Message Identifier

Configures how to identify a redelivered message and how to find out when the message was redelivered.

Field Type Description Default Value Required

Use Secure Hash

Boolean

If true, Mule uses a secure hash algorithm to identify a redelivered message.

Id Expression

String

One or more expressions that determine when a message was redelivered. You can set this property only if the Use Secure Hash field is false.

Event

Field Type Description Default Value Required

Body

String

Body of the event.

Metadata

Object

Metadata of the event.

Off Set

Field Type Description Default Value Required

Offset

Number

An offset is the position of an event within a partition.

x

Sequence

Field Type Description Default Value Required

Sequence

Number

The sequence number assigned to the event when it was enqueued in the associated Event Hub partition.

x

Enqueued Time

Field Type Description Default Value Required

Instant

String

Selects the enqueue time to start looking for an event.

x

Azure Blob Storage SAS Authentication

Field Type Description Default Value Required

Container Name

String

Container name.

x

Account Name

String

Account name of the Azure account.

x

Account Key

String

Account key of the Azure account.

x

Azure Blob Storage Active Directory Authentication

Field Type Description Default Value Required

Token Credential Properties

Acquires a token via service principal authentication.

Use Azure Default Credential

Boolean

Setting this flag to true, DefaultAzureCredential Class(Azure.Identity) is created to get a token to authenticate.

false

Container Name

String

Container name.

x

Account Name

String

Account name of the Azure account.

x

Authority Host

String

Specifies the Azure active directory host. Defaults to https://login.microsoftonline.com/

SAS Authentication

Field Type Description Default Value Required

Namespace

String

Event Hubs namespace name.

x

Shared Access Key Name

String

Shared access key name given by Azure

x

Shared Access Key

String

Shared access key value given by Azure.

x

Event Hub Name

String

Event Hub name.

x

Share Connection

Boolean

Toggles the builder to use the same connection for producers or consumers.

false

Checkpoint Store Type

Select the checkpointing connection provider.

Active Directory Authentication

Field Type Description Default Value Required

Token Credential Properties

Acquires a token via service principal authentication.

Use Azure Default Credential

Boolean

Setting this flag to true, DefaultAzureCredential Class(Azure.Identity) is created to get a token to authenticate.

false

Namespace

String

Event Hubs namespace name.

x

Authority Host

String

Specifies the Azure active directory host. Defaults to https://login.microsoftonline.com/

Event Hub Name

String

Event Hub name.

x

Share Connection

Boolean

Toggles the builder to use the same connection for producers or consumers.

false

Checkpoint Store Type

Select the checkpointing connection provider.

View on GitHub