You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Azure Event Hubs Checkpoint Store for Blob Storage
2
3
3
4
This crate provides a checkpoint store implementation for Azure Event Hubs using Azure Blob Storage as the backend. It implements the `CheckpointStore` trait from the `azure_messaging_eventhubs` crate, allowing you to persist checkpoints (event positions) to Azure Blob Storage.
@@ -9,18 +10,64 @@ This crate provides a checkpoint store implementation for Azure Event Hubs using
9
10
-**Concurrency Support**: Handle multiple processors with proper concurrency control
10
11
-**Easy Integration**: Drop-in replacement for other checkpoint store implementations
- A Rust Compiler. See [the rust compiler installation instructions](https://www.rust-lang.org/tools/install).
30
+
- An [Azure subscription]
31
+
- The [Azure CLI]
32
+
- An [Event Hub namespace](https://learn.microsoft.com/azure/event-hubs/).
33
+
- An Event Hub instance. You can create an Event Hub instance in your Event Hubs Namespace using the [Azure Portal](https://learn.microsoft.com/azure/event-hubs/event-hubs-create), or the [Azure CLI](https://learn.microsoft.com/azure/event-hubs/event-hubs-quickstart-cli).
34
+
35
+
If you use the Azure CLI, replace `<your-resource-group-name>`, `<your-eventhubs-namespace-name>`, and `<your-eventhub-name>` with your own, unique names:
36
+
37
+
Create an Event Hubs Namespace:
38
+
39
+
```azurecli
40
+
az eventhubs namespace create --resource-group <your-resource-group-name> --name <your-eventhubs-namespace-name> --sku Standard
41
+
```
42
+
43
+
Create an Event Hub Instance:
44
+
45
+
```azurecli
46
+
az eventhubs eventhub create --resource-group <your-resource-group-name> --namespace-name <your-eventhubs-namespace-name> --name <your-eventhub-name>
47
+
```
48
+
49
+
### Install dependencies
50
+
51
+
Add the following crates to your project:
52
+
53
+
```sh
54
+
cargo add azure_identity tokio azure_messaging_eventhubs azure_storage_blob
55
+
```
56
+
57
+
### Authenticate the client
13
58
14
-
Add this to your `Cargo.toml`:
59
+
Before interacting with Azure services, you need a credential to use to authenticate and authorize the user.
The example shown below uses a [`DefaultAzureCredential`][default_cred_ref], which is appropriate for most local development environments. Additionally, we recommend using a managed identity for authentication in production environments. You can find more information on different ways of authenticating and their corresponding credential types in the [Azure Identity] documentation.
62
+
63
+
The `DefaultAzureCredential` will automatically pick up on an Azure CLI authentication. Ensure you are logged in with the Azure CLI:
64
+
65
+
```azurecli
66
+
az login
22
67
```
23
68
69
+
Instantiate a `DefaultAzureCredential` to pass to the client. The same instance of a token credential can be used with multiple clients if they will be authenticating with the same identity.
70
+
24
71
### Basic Example
25
72
26
73
This example creates a blob container client on the storage account which will hold the blob checkpoint store, and configures a blob checkpoint store to use that storage client.
When you interact with the Azure Event Hubs Checkpoint Store using the Rust SDK, errors returned by the service are returned as `azure_core::Error` values. However in general, client applications will not interact with the Checkpoint Store - the Checkpoint Store functionality is primarily used by the Event Hubs event processor.
134
+
135
+
### Logging
136
+
137
+
The Event Hubs SDK client uses the [tracing](https://docs.rs/tracing/latest/tracing/) package to
138
+
enable diagnostics.
139
+
140
+
## Contributing
141
+
142
+
See the [CONTRIBUTING.md] for details on building, testing, and contributing to these libraries.
143
+
144
+
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://opensource.microsoft.com/cla/>.
145
+
146
+
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
147
+
148
+
This project has adopted the [Microsoft Open Source Code of Conduct]. For more information see the [Code of Conduct FAQ] or contact <[email protected]> with any additional questions or comments.
149
+
150
+
### Reporting security issues and security bugs
151
+
152
+
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) <[email protected]>. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://www.microsoft.com/msrc/faqs-report-an-issue).
153
+
154
+
### License
155
+
156
+
Azure SDK for Rust is licensed under the [MIT](https://github.com/Azure/azure-sdk-for-cpp/blob/main/LICENSE.txt) license.
0 commit comments