https://github.com/shuttle/shuttle.esb.azureeventhubs
Azure Event Hubs implementation for use with Shuttle.Esb.
https://github.com/shuttle/shuttle.esb.azureeventhubs
Last synced: about 1 month ago
JSON representation
Azure Event Hubs implementation for use with Shuttle.Esb.
- Host: GitHub
- URL: https://github.com/shuttle/shuttle.esb.azureeventhubs
- Owner: Shuttle
- License: bsd-3-clause
- Created: 2022-11-04T11:21:10.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-02T14:06:37.000Z (3 months ago)
- Last Synced: 2025-03-23T22:14:20.728Z (about 2 months ago)
- Language: C#
- Size: 87.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AzureEventHubs
```
PM> Install-Package Shuttle.Esb.AzureEventHubs
```## Configuration
The URI structure is `azureeh://configuration-name/queue-name`.
```c#
services.AddAzureEventHubs(builder =>
{
var eventHubQueueOptions = new EventHubQueueOptions
{
ConnectionString = "UseDevelopmentStorage=true",
ProcessEvents = false,
ConsumerGroup = EventHubConsumerClient.DefaultConsumerGroupName,
BlobStorageConnectionString = "{BlobStorageConnectionString}",
BlobContainerName = "{BlobContainerName}",
OperationTimeout = TimeSpan.FromSeconds(30),
ConsumeTimeout = TimeSpan.FromSeconds(30),
DefaultStartingPosition = EventPosition.Latest
};eventHubQueueOptions.ConfigureProducer += (sender, args) =>
{
Console.WriteLine($"[event] : ConfigureProducer / Uri = '{((IQueue)sender).Uri}'");
};eventHubQueueOptions.ConfigureBlobStorage += (sender, args) =>
{
Console.WriteLine($"[event] : ConfigureBlobStorage / Uri = '{((IQueue)sender).Uri}'");
};eventHubQueueOptions.ConfigureConsumer += (sender, args) =>
{
Console.WriteLine($"[event] : ConfigureConsumer / Uri = '{((IQueue)sender).Uri}'");
};builder.AddOptions("azure", eventHubQueueOptions);
});
```In the `Configure` events the `args` arugment exposes the relevant client options directly should you need to set an values explicitly.
The default JSON settings structure is as follows:
```json
{
"Shuttle": {
"AzureEventHubs": {
"azure": {
"ConnectionString": "UseDevelopmentStorage=true",
"ProcessEvents": false,
"ConsumerGroup": "$Default",
"BlobStorageConnectionString": "{BlobStorageConnectionString}",
"BlobContainerName": "{BlobContainerName}",
"OperationTimeout": "00:00:30",
"ConsumeTimeout": "00:00:30",
"DefaultStartingPosition": "Latest"
}
}
}
}
```## Options
| Segment / Argument | Default | Description |
| --- | --- | --- |
| `ConnectionString` | | The Azure Event Hubs endpoint to connect to. |
| `ProcessEvents` | `false` | Indicates whether the endpoint will process messages. If `true`, an `EventProcessorClient` is instanced and configured. |
| `ConsumerGroup` | "$Default" | The consumer group to use when processing events. |
| `BlobStorageConnectionString` | | The Azure Storage Account endpoint to connect to in order to perform checkpoints. |
| `BlobContainerName` | | The blob container name where checkpoints will be stored. |
| `OperationTimeout` | "00:00:30" | The duration to wait for relevant `async` methods to complete before timing out. |
| `ConsumeTimeout` | "00:00:30" | The duration to poll for messages before returning `null`. |
| `DefaultStartingPosition` | | The default starting position to use when no checkpoint exists. |