Azure Event Hubs
Send events to and receive events from Azure Event Hubs over AMQP.
What’s inside
-
Azure Event Hubs component, URI syntax:
azure-eventhubs:namespace/eventHubName
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-azure-eventhubs-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 26 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.azure-eventhubs.amqp-retry-options | The retry policy (com.azure.core.amqp.AmqpRetryOptions) of the Event Hubs clients that the producer and the consumer create. When not set, the SDK default applies: up to 3 retries, with an exponential delay from 0.8 seconds up to 1 minute, and a timeout of 1 minute per try. Not applied to a producerAsyncClient that you provide. The option is a com.azure.core.amqp.AmqpRetryOptions type. | AmqpRetryOptions | |
camel.component.azure-eventhubs.amqp-transport-type | The transport of the connection to Event Hubs: AMQP (AMQP over TCP, port 5671) or AMQP_WEB_SOCKETS (AMQP over web sockets, port 443, for networks that block port 5671). Not applied to a producerAsyncClient that you provide. | amqp | AmqpTransportType |
camel.component.azure-eventhubs.autowired-enabled | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | Boolean |
camel.component.azure-eventhubs.blob-access-key | The access key of the Azure Storage account blobAccountName, for the default BlobCheckpointStore. Not used when checkpointStore or blobStorageSharedKeyCredential is set. | String | |
camel.component.azure-eventhubs.blob-account-name | The name of the Azure Storage account of the default BlobCheckpointStore, used as https://ACCOUNT.blob.core.windows.net with blobAccessKey. Not used when checkpointStore or blobStorageSharedKeyCredential is set. | String | |
camel.component.azure-eventhubs.blob-container-name | The name of the blob container in which the default BlobCheckpointStore stores the partition ownership and the checkpoints. The container must exist. Required when checkpointStore is not set. | String | |
camel.component.azure-eventhubs.blob-storage-shared-key-credential | The com.azure.storage.common.StorageSharedKeyCredential (account name and access key) of the Azure Storage account of the default BlobCheckpointStore, instead of blobAccountName and blobAccessKey. The option is a com.azure.storage.common.StorageSharedKeyCredential type. | StorageSharedKeyCredential | |
camel.component.azure-eventhubs.bridge-error-handler | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | Boolean |
camel.component.azure-eventhubs.checkpoint-batch-size | The number of events of a partition whose exchanges completed successfully, after which the consumer updates the checkpoint of the partition in the checkpoint store, without waiting for checkpointBatchTimeout. A checkpoint never passes an event whose exchange is still in flight; an event whose exchange failed is not received again, and the next checkpoint passes it. | 500 | Integer |
camel.component.azure-eventhubs.checkpoint-batch-timeout | The time in milliseconds after which the consumer updates the checkpoint of a partition for the events completed since the last checkpoint, when checkpointBatchSize is not reached first. The time starts with the first event completed after the last checkpoint. | 5000 | Integer |
camel.component.azure-eventhubs.checkpoint-store | The com.azure.messaging.eventhubs.CheckpointStore in which the EventProcessorClient of the consumer stores the partition ownership and the checkpoints of the consumer group: the consumers of the group share the partitions through it, and a consumer that takes a partition resumes after its last checkpoint. When not set, a BlobCheckpointStore in Azure Blob Storage is created from blobContainerName and blobAccountName with blobAccessKey, or blobStorageSharedKeyCredential. The option is a com.azure.messaging.eventhubs.CheckpointStore type. | CheckpointStore | |
camel.component.azure-eventhubs.configuration | The component configurations. The option is a org.apache.camel.component.azure.eventhubs.EventHubsConfiguration type. | EventHubsConfiguration | |
camel.component.azure-eventhubs.connection-string | The connection string of the Event Hubs namespace or of the event hub, with the endpoint, the shared access key name and the key. It must contain EntityPath=NAME with the name of the event hub: add it to a connection string copied from the namespace. Used when credentialType is CONNECTION_STRING; it replaces the namespace and the event hub name of the URI path, sharedAccessName and sharedAccessKey. | String | |
camel.component.azure-eventhubs.consumer-group-name | The consumer group that the consumer reads the events in. Each consumer group has its own checkpoints and partition ownership, so the consumers of one group share the partitions. $Default is the consumer group that every event hub has. | $Default | String |
camel.component.azure-eventhubs.credential-type | How to authenticate: CONNECTION_STRING with connectionString, or with sharedAccessName and sharedAccessKey; TOKEN_CREDENTIAL with the tokenCredential option; AZURE_IDENTITY with a DefaultAzureCredential, the tokenCredential option when it is set, otherwise a new one. TOKEN_CREDENTIAL and AZURE_IDENTITY need the namespace and the event hub name of the URI path. When not set, it is TOKEN_CREDENTIAL (or AZURE_IDENTITY for a DefaultAzureCredential) when tokenCredential is set, else CONNECTION_STRING. | connection-string | CredentialType |
camel.component.azure-eventhubs.enabled | Whether to enable auto configuration of the azure-eventhubs component. This is enabled by default. | Boolean | |
camel.component.azure-eventhubs.event-position | The position to start reading a partition from when the checkpoint store has no checkpoint for it, as a map from the partition id to a com.azure.messaging.eventhubs.models.EventPosition. A partition with no checkpoint and no entry starts at EventPosition.latest(): only the events enqueued after the consumer starts reading are received. | EventPosition> | |
camel.component.azure-eventhubs.header-filter-strategy | To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message. The option is a org.apache.camel.spi.HeaderFilterStrategy type. | HeaderFilterStrategy | |
camel.component.azure-eventhubs.lazy-start-producer | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | Boolean |
camel.component.azure-eventhubs.partition-id | The id of the partition that the events are sent to. The CamelAzureEventHubsPartitionId header overrides it. When neither a partition id nor a partition key is set, Event Hubs chooses the partition. Sending fails when a partition key and a partition id are both set. | String | |
camel.component.azure-eventhubs.partition-key | The partition key of the events: Event Hubs hashes it to choose the partition, so the events with the same key go to the same partition. The CamelAzureEventHubsPartitionKey header overrides it. Use it to keep related events together; use partitionId to send to one partition. Sending fails when a partition key and a partition id are both set. | String | |
camel.component.azure-eventhubs.prefetch-count | The number of events that the Event Hubs client receives and queues locally for each partition, ahead of their processing, from 1 to 8000. Note: the consumer does not pass this option to its EventProcessorClient, which uses its own default of 500. | 500 | Integer |
camel.component.azure-eventhubs.producer-async-client | The com.azure.messaging.eventhubs.EventHubProducerAsyncClient that the producer sends the events with, instead of a client that it creates. The producer does not close it, and the credential, transport and retry options do not apply to it. Not used by the consumer. The option is a com.azure.messaging.eventhubs.EventHubProducerAsyncClient type. | EventHubProducerAsyncClient | |
camel.component.azure-eventhubs.shared-access-key | The primary or secondary key of the shared access policy named by sharedAccessName. | String | |
camel.component.azure-eventhubs.shared-access-name | The name of the shared access policy (SAS key name) of the namespace or the event hub. With sharedAccessKey, the namespace and the event hub name of the URI path, it builds the connection string when credentialType is CONNECTION_STRING and connectionString is not set. | String | |
camel.component.azure-eventhubs.token-credential | The com.azure.core.credential.TokenCredential to authenticate with Microsoft Entra ID, for credentialType TOKEN_CREDENTIAL or AZURE_IDENTITY, with the namespace and the event hub name of the URI path. A DefaultAzureCredential built with a managed identity client id or a tenant id is used as it is. The option is a com.azure.core.credential.TokenCredential type. | TokenCredential |