Azure Event Hubs Connector Reference 1.2 | MuleSoft Documentation
# Azure Event Hubs Connector Reference 1.2
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 for this configuration. Connectors reference the configuration with this name.  
Connection | 
  * Active Directory Authentication
  * SAS Authentication

| Connection types for this configuration.  
ID used to reference this configuration.  
Expiration Policy |  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 |  Token Credential Properties | Acquires a token via service principal authentication.  
Use Azure Default Credential | Use DefaultAzureCredentials mechanism.  
Namespace | Event Hubs namespace name.  
Azure Endpoint | Fully qualified domain name of the Event Hubs namespace. | servicebus.windows.net  
Authority Host | Specifies the Azure active directory host. | https://login.microsoftonline.com/  
Event Hub Name | Event Hub name.  
Share Connection | Toggles the builder to use the same connection for producers or consumers.  
Checkpoint Store Type |  One of:
  * Azure Blob Storage SAS Authentication
  * Azure Blob Storage Active Directory Authentication

| 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 | Event Hubs namespace name.  
Shared Access Key Name | Shared access key name given by Azure.  
Shared Access Key | Shared access key value given by Azure.  
Event Hub Name | Event Hub name.  
Share Connection | Toggles the builder to use the same connection for producers or consumers.  
Checkpoint Store Type |  One of:
  * Azure Blob Storage SAS Authentication
  * Azure Blob Storage Active Directory Authentication

| 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
  * Publish in bulk
  * Send a single event


## Associated Sources
  * Partition Listener
  * Eventhub Listener


## 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 | ID used to reference this configuration.  
Array of Event | The event’s content. | #[payload]  
Correlation Id | Correlation ID.  
Content Type | 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 | Allow numbers greater than 24. If not configured, takes the default value configured in the Azure account.  
Config Ref |  ConfigurationProvider | Name of the configuration to use to execute this component.  
Partition Id | Partition ID.  
Partition Key | Partition key.  
Reconnection Strategy | 
  *   * Reconnect Forever

| Retry strategy in case of connectivity errors.  
### For Configurations
  * Azure Event Hubs


### 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 | Name of the configuration to use.  
The event’s content | #[payload]  
Correlation Id | Correlation ID.  
Content Type | 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.  
Partition Id | Partition ID.  
Partition Key | Partition key.  
Reconnection Strategy | 
  *   * Reconnect Forever

| Retry strategy in case of connectivity errors.  
### For Configurations
  * Azure Event Hubs


### Throws
  * AZURE-EVENTHUBS:AEH_ERROR
  * AZURE-EVENTHUBS:AUTHENTICATION
  * AZURE-EVENTHUBS:CONNECTIVITY
  * AZURE-EVENTHUBS:INVALID_INPUT
  * AZURE-EVENTHUBS:RETRY_EXHAUSTED


## 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 | ID used to reference this configuration.  
Partition Id | Partition ID of the event hub.  
Consumer Group | The consumer group to belong to.  
Event Position Type |  One of:
  * Earliest
  * Latest
  * 
| 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 | The mime type of the payload that this operation outputs.  
Output Encoding | The encoding of the payload that this operation outputs.  
Config Ref |  ConfigurationProvider | Name of the configuration to use to execute this component.  
Primary Node Only | Determines whether to execute this source on only the primary node when running Mule instances in a cluster.  
On Capacity Overload |  Enumeration, one of: | Strategy that Mule applies when the flow receives more messages than it has the capacity to manage.  
Streaming Strategy | 
  * Repeatable In Memory Stream
  * Repeatable File Store Stream
  * non-repeatable-stream

| Configures how Mule processes streams. Repeatable streams are the default behavior.  
Redelivery Policy |  Redelivery Policy | Defines a policy for processing the redelivery of the same message.  
Reconnection Strategy | 
  *   * Reconnect Forever

| Reconnection strategy to use.  
### Output
Attributes Type |  Event Attributes  
---|---  
### For Configurations
  * Azure Event Hubs


## Eventhub Listener
`<azure-eventhubs:eventhub-listener>`
Reads events from an event hub in a namespace.
### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | ID used to reference this configuration.  
Consumer Group | The consumer group to belong to.  
Event Position Type |  One of:
  * Earliest
  * Latest
  * 
| Defines the position of an event in an Event Hub partition. The position can be an enqueued time, the start of the stream, or the end of the stream.  
Checkpoint Frequency | Frequency of updating the checkpoint. For instance, every 1000 events received.  
Output Mime Type | Mime type of the payload that this operation outputs.  
Output Encoding | Encoding of the payload that this operation outputs.  
Config Ref |  ConfigurationProvider | Name of the configuration to use to execute this component.  
Primary Node Only | Determines whether to execute this source on only the primary node when running Mule instances in a cluster.  
On Capacity Overload |  Enumeration, one of: | Strategy that Mule applies when the flow receives more messages than it has the capacity to manage.  
Streaming Strategy | 
  * Repeatable In Memory Stream
  * Repeatable File Store Stream
  * non-repeatable-stream

| Configures how Mule processes streams. Repeatable streams are the default behavior.  
Redelivery Policy |  Redelivery Policy | Defines a policy for processing the redelivery of the same message.  
Reconnection Strategy | 
  *   * Reconnect Forever

| Reconnection strategy to use.  
### Output
Attributes Type |  Event Attributes  
---|---  
### For Configurations
  * Azure Event Hubs


## Types
### Token Credential Properties
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
**Client Secret** |  Client secret.  
### Reconnection
Configures a reconnection strategy for an operation.
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
**Fails Deployment** |  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** | 
  *   * Reconnect Forever
| Configures how Mule processes streams. Repeatable streams are the default behavior.  
Redelivery Policy |  Redelivery Policy | Defines a policy for processing the redelivery of the same message.  
Reconnection Strategy | 
  *   * Reconnect Forever

| Reconnection strategy to use.  
### Output
Attributes Type |  Event Attributes  
---|---  
### For Configurations
  * Azure Event Hubs


## Types
### Token Credential Properties
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
**Client Secret** |  Client secret.  
### Reconnection
Configures a reconnection strategy for an operation.
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
**Fails Deployment** |  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** | 
  *   * Reconnect Forever

|  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  
---|---|---|---|---  
How often to attempt to reconnect, in milliseconds.  
If `false`, the reconnection strategy runs in a separate, non-blocking thread.  
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  
---|---|---|---|---  
How often to attempt to reconnect, in milliseconds.  
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** |  Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.  
Enumeration, one of:
  * NANOSECONDS
  * MICROSECONDS
  * MILLISECONDS
  * SECONDS
  * MINUTES
  * HOURS

|  Time unit for the **Max Idle Time** field.  
### Event Attributes
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
**Content Type** |  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** |  Correlation ID.  
**Enqueued Time** |  The date and time, in UTC, of when the event was enqueued in the Event Hub partition.  
**Message Id** |  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.  
Custom data added to the Event, it exists only for coordination between event publishers and consumers.  
An offset is the position of an event within a partition.  
**Sequence 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** |  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** |  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** |  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: |  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** |  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: |  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** |  Maximum number of times that a redelivered request can be processed unsuccessfully before returning a REDELIVERY_EXHAUSTED error.  
**Message Digest Algorithm** |  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** |  Redelivery Policy 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** |  If `true`, Mule uses a secure hash algorithm to identify a redelivered message.  
**Id Expression** |  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 of the event.  
Metadata of the event.  
### Off Set
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
An offset is the position of an event within a partition.  
### Sequence
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
The sequence number assigned to the event when it was enqueued in the associated Event Hub partition.  
### Enqueued Time
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Selects the enqueue time to start looking for an event.  
### Azure Blob Storage SAS Authentication
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
**Container Name** |  Container name.  
**Account Name** |  Account name of the Azure account.  
**Account Key** |  Account key of the Azure account.  
### Azure Blob Storage Active Directory Authentication
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
**Token Credential Properties** |  Token Credential Properties |  Acquires a token via service principal authentication.  
**Use Azure Default Credential** |  Setting this flag to `true`, DefaultAzureCredential Class(Azure.Identity) is created to get a token to authenticate.  
**Container Name** |  Container name.  
**Account Name** |  Account name of the Azure account.  
**Authority Host** |  Specifies the Azure active directory host. |  https://login.microsoftonline.com/  
### SAS Authentication
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Event Hubs namespace name.  
**Shared Access Key Name** |  Shared access key name given by Azure  
**Shared Access Key** |  Shared access key value given by Azure.  
**Event Hub Name** |  Event Hub name.  
**Share Connection** |  Toggles the builder to use the same connection for producers or consumers.  
**Checkpoint Store Type** |  One of:
  * Azure Blob Storage SAS Authentication
  * Azure Blob Storage Active Directory Authentication
|  Select the checkpointing connection provider.  
### Active Directory Authentication
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
**Token Credential Properties** |  Token Credential Properties |  Acquires a token via service principal authentication.  
**Use Azure Default Credential** |  Setting this flag to `true`, DefaultAzureCredential Class(Azure.Identity) is created to get a token to authenticate.  
Event Hubs namespace name.  
**Authority Host** |  Specifies the Azure active directory host. |  https://login.microsoftonline.com/  
**Event Hub Name** |  Event Hub name.  
**Share Connection** |  Toggles the builder to use the same connection for producers or consumers.  
**Checkpoint Store Type** |  One of:
  * Azure Blob Storage SAS Authentication
  * Azure Blob Storage Active Directory Authentication

|  Select the checkpointing connection provider.