Skip to content

Commit 6c7d6aa

Browse files
[EventHub] merge geodr (Azure#40359)
* [EventHub] geodr preview * add georep to producer desired cap * add link on enabling geor in changelog * add more description in changelog * fix links * update beta version in docs * [Eventhub] geodr preview (Azure#39699) * [EventHub] geodr preview * add georep to producer desired cap * add link on enabling geor in changelog * add more description in changelog * fix links * update beta version in docs * [EventHub] geodr preview * add georep to producer desired cap * fix links * update beta version in docs * [Eventhub] geodr preview (Azure#39699) * [EventHub] geodr preview * add georep to producer desired cap * add link on enabling geor in changelog * add more description in changelog * fix links * update beta version in docs * Ws impl (Azure#39718) * sync sb changes for legacy and new ws * async sb changes for legacy and new ws * sb websocket files * eh changes for sync ws and legacy switch * eh changes for async ws and legacy switch * add websocket lib * pylint fixes * pass proxy info only when specified * handle ssl context * fix tests & pylint * pass in ssl context * handle ssl opts * raise proper error from ws library * fix for macos * suppress bandit for handshake * raise ssl error on failure * update sb changelog * [SB/EH] pylint * update classifier (Azure#40054) * update beta changelog date * Update CHANGELOG.md * [EH/SB] update release date + classifier * Remove ws beta (Azure#40343) * remove legacy_ws kwarg * remove new ws transport in pyamqp * remove ws files * restore unit test * remove legacy_ws kwarg * remove new ws transport support * remove ws files * remove legacy websocket class * remove websocket from eh * revert sb changes from merge * update EH geodr for GA --------- Co-authored-by: Kashif Khan <[email protected]>
1 parent 1566897 commit 6c7d6aa

File tree

8 files changed

+53
-9
lines changed

8 files changed

+53
-9
lines changed

sdk/eventhub/azure-eventhub/CHANGELOG.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
# Release History
22

3-
## 5.15.0 (Unreleased)
3+
## 5.15.0 (2025-04-09)
44

55
### Features Added
66

7-
- Added a class method `from bytes` to create `EventData` from a message payload of bytes. ([#39711](https://github.com/Azure/azure-sdk-for-python/issues/39711))
7+
- Added support for geo-replication and disaster recovery-enabled Event Hubs. To learn more about geo-replication, refer to this [doc](https://learn.microsoft.com/azure/event-hubs/geo-replication). To enable geo-replication on your Dedicated Event Hubs namespace, refer to [this guide](https://learn.microsoft.com/azure/event-hubs/use-geo-replication).
8+
- Added a class method `from bytes` to `EventData` to create from a message payload of bytes. ([#39711](https://github.com/Azure/azure-sdk-for-python/issues/39711))
9+
10+
### Bugs Fixed
11+
12+
- Fixed a bug where service errors were incorrectly required and expected to have info/description fields.
13+
14+
### Other Changes
15+
16+
- The following change has been temporarily pulled out and will be added to a future release:
17+
- Implemented a new websockets library so that using `AmqpOverWebsocket` no longer requires separate optional dependency installations.
18+
19+
## 5.15.0b2 (2025-03-14)
20+
21+
### Features Added
22+
23+
- Implemented a new websockets library so that using `AmqpOverWebsocket` no longer requires separate optional dependency installations.
24+
25+
## 5.15.0b1 (2025-02-13)
26+
27+
### Features Added
28+
29+
- Added support for geo-replication and disaster recovery-enabled Event Hubs. To learn more about geo-replication, refer to this [doc](https://learn.microsoft.com/azure/event-hubs/geo-replication). To enable geo-replication on your Dedicated Event Hubs namespace, refer to [this guide](https://learn.microsoft.com/azure/event-hubs/use-geo-replication).
830

931
### Bugs Fixed
1032

sdk/eventhub/azure-eventhub/azure/eventhub/_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
EPOCH_SYMBOL = b"com.microsoft:epoch"
3232
TIMEOUT_SYMBOL = b"com.microsoft:timeout"
3333
RECEIVER_RUNTIME_METRIC_SYMBOL = b"com.microsoft:enable-receiver-runtime-metric"
34+
GEOREPLICATION_SYMBOL = b"com.microsoft:georeplication"
3435

3536
MAX_MESSAGE_LENGTH_BYTES = 1024 * 1024
3637
MAX_USER_AGENT_LENGTH = 512

sdk/eventhub/azure-eventhub/azure/eventhub/_consumer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
EPOCH_SYMBOL,
1818
TIMEOUT_SYMBOL,
1919
RECEIVER_RUNTIME_METRIC_SYMBOL,
20+
GEOREPLICATION_SYMBOL,
2021
)
2122

2223
if TYPE_CHECKING:
@@ -131,7 +132,12 @@ def _create_handler(self, auth: Union[uamqp_JWTTokenAuth, JWTTokenAuth]) -> None
131132
self._offset,
132133
event_position_selector(self._offset, self._offset_inclusive),
133134
)
134-
desired_capabilities = [RECEIVER_RUNTIME_METRIC_SYMBOL] if self._track_last_enqueued_event_properties else None
135+
desired_capabilities = (
136+
[RECEIVER_RUNTIME_METRIC_SYMBOL,
137+
GEOREPLICATION_SYMBOL]
138+
if self._track_last_enqueued_event_properties
139+
else [GEOREPLICATION_SYMBOL]
140+
)
135141

136142
self._handler = self._amqp_transport.create_receive_client(
137143
config=self._client._config, # pylint:disable=protected-access

sdk/eventhub/azure-eventhub/azure/eventhub/_producer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
is_tracing_enabled,
3030
TraceAttributes,
3131
)
32-
from ._constants import TIMEOUT_SYMBOL
32+
from ._constants import TIMEOUT_SYMBOL, GEOREPLICATION_SYMBOL
3333
from .amqp import AmqpAnnotatedMessage
3434

3535
_LOGGER = logging.getLogger(__name__)
@@ -124,6 +124,7 @@ def __init__(self, client: "EventHubProducerClient", target: str, **kwargs: Any)
124124
super(EventHubProducer, self).__init__()
125125

126126
def _create_handler(self, auth: Union[uamqp_JWTTokenAuth, JWTTokenAuth]) -> None:
127+
desired_capabilities = [GEOREPLICATION_SYMBOL]
127128
self._handler = self._amqp_transport.create_send_client(
128129
config=self._client._config, # pylint:disable=protected-access
129130
target=self._target,
@@ -134,6 +135,7 @@ def _create_handler(self, auth: Union[uamqp_JWTTokenAuth, JWTTokenAuth]) -> None
134135
keep_alive_interval=self._keep_alive,
135136
client_name=self._name,
136137
link_properties=self._link_properties, # type: ignore
138+
desired_capabilities=desired_capabilities,
137139
properties=create_properties(
138140
self._client._config.user_agent, # pylint: disable=protected-access
139141
amqp_transport=self._amqp_transport,

sdk/eventhub/azure-eventhub/azure/eventhub/_version.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
# Licensed under the MIT License.
44
# ------------------------------------
55

6-
76
VERSION = "5.15.0"

sdk/eventhub/azure-eventhub/azure/eventhub/aio/_consumer_async.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414
from ._async_utils import get_dict_with_loop_if_needed
1515
from .._common import EventData
1616
from .._utils import create_properties, event_position_selector
17-
from .._constants import EPOCH_SYMBOL, TIMEOUT_SYMBOL, RECEIVER_RUNTIME_METRIC_SYMBOL
17+
from .._constants import (
18+
EPOCH_SYMBOL,
19+
TIMEOUT_SYMBOL,
20+
RECEIVER_RUNTIME_METRIC_SYMBOL,
21+
GEOREPLICATION_SYMBOL,
22+
)
1823

1924
if TYPE_CHECKING:
2025
try:
@@ -129,7 +134,12 @@ def _create_handler(self, auth: Union["uamqp_JWTTokenAsync", JWTTokenAuthAsync])
129134
self._offset,
130135
event_position_selector(self._offset, self._offset_inclusive),
131136
)
132-
desired_capabilities = [RECEIVER_RUNTIME_METRIC_SYMBOL] if self._track_last_enqueued_event_properties else None
137+
desired_capabilities = (
138+
[RECEIVER_RUNTIME_METRIC_SYMBOL,
139+
GEOREPLICATION_SYMBOL]
140+
if self._track_last_enqueued_event_properties
141+
else [GEOREPLICATION_SYMBOL]
142+
)
133143

134144
self._handler = self._amqp_transport.create_receive_client(
135145
config=self._client._config, # pylint:disable=protected-access

sdk/eventhub/azure-eventhub/azure/eventhub/aio/_producer_async.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
is_tracing_enabled,
2323
TraceAttributes,
2424
)
25-
from .._constants import TIMEOUT_SYMBOL
25+
from .._constants import TIMEOUT_SYMBOL, GEOREPLICATION_SYMBOL
2626
from ..amqp import AmqpAnnotatedMessage
2727
from ._client_base_async import ConsumerProducerMixin
2828
from ._async_utils import get_dict_with_loop_if_needed
@@ -109,6 +109,7 @@ def __init__(self, client: EventHubProducerClient, target: str, **kwargs: Any) -
109109
)
110110

111111
def _create_handler(self, auth: Union["uamqp_JWTTokenAsync", JWTTokenAuthAsync]) -> None:
112+
desired_capabilities = [GEOREPLICATION_SYMBOL]
112113
self._handler = self._amqp_transport.create_send_client(
113114
config=self._client._config, # pylint:disable=protected-access
114115
target=self._target,
@@ -119,6 +120,7 @@ def _create_handler(self, auth: Union["uamqp_JWTTokenAsync", JWTTokenAuthAsync])
119120
keep_alive_interval=self._keep_alive,
120121
client_name=self._name,
121122
link_properties=self._link_properties,
123+
desired_capabilities=desired_capabilities,
122124
properties=create_properties(
123125
self._client._config.user_agent, # pylint: disable=protected-access
124126
amqp_transport=self._amqp_transport,

sdk/eventhub/test-resources.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@
122122
]
123123
}
124124
],
125-
"properties": {}
125+
"properties": {
126+
"disableLocalAuth": true
127+
}
126128
},
127129
{
128130
"type": "Microsoft.Storage/storageAccounts",

0 commit comments

Comments
 (0)