Skip to content

Commit 84fd946

Browse files
EventHubs GeoDr functionality (#2889)
Implement the last bits of GeoDr functionality in EventHubs. --------- Co-authored-by: Copilot <[email protected]>
1 parent b9f114e commit 84fd946

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

sdk/eventhubs/azure_messaging_eventhubs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Features Added
66

77
- Reconnect support for EventHubs operations.
8+
- Enable [Geo Replication](https://learn.microsoft.com/azure/event-hubs/geo-replication) support in Event Hubs consumers and producers.
89

910
### Breaking Changes
1011

sdk/eventhubs/azure_messaging_eventhubs/src/common/recoverable/connection.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All Rights reserved
22
// Licensed under the MIT license.
33

4+
// cspell:ignore geodr georeplication
5+
46
use super::{
57
claims_based_security::RecoverableClaimsBasedSecurity, management::RecoverableManagementClient,
68
receiver::RecoverableReceiver, sender::RecoverableSender,
@@ -31,6 +33,12 @@ use std::{
3133
};
3234
use tracing::{debug, span, trace, warn};
3335

36+
/// The AMQP capability string used to negotiate geographic replication features
37+
/// between client and server. This capability is advertised during AMQP connection setup to indicate
38+
/// support for geographic replication, allowing clients and Event Hubs to coordinate failover and replication
39+
/// scenarios for high availability.
40+
const GEODR_REPLICATION_CAPABILITY: &str = "com.microsoft.georeplication";
41+
3442
/// The recoverable connection is responsible for managing the connection to the Event Hubs service.
3543
/// It also handles authorization and connection recovery.
3644
///
@@ -292,6 +300,7 @@ impl RecoverableConnection {
292300
.map(|(k, v)| (AmqpSymbol::from(k), AmqpValue::from(v)))
293301
.collect(),
294302
),
303+
desired_capabilities: Some(vec![GEODR_REPLICATION_CAPABILITY.into()]),
295304
custom_endpoint: self.custom_endpoint.clone(),
296305
..Default::default()
297306
}),

0 commit comments

Comments
 (0)