Skip to content

Commit 1e53ab7

Browse files
authored
[EH] Set AMQP Client Link Max Message Size to 0 (#43462)
* no restriction on max message size in amqp attach * eh constant changed correctly, sb change reverted * log addition
1 parent 2037678 commit 1e53ab7

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

sdk/eventhub/azure-eventhub/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
- Fixed a bug where service errors were incorrectly required and expected to have info/description fields.
2323
- Fixed a bug so that the BufferedProducer ThreadPoolExecutor uses one worker per partition. ([#38961](https://github.com/Azure/azure-sdk-for-python/issues/38961))
24+
- Fixed a bug in the EventHub client where the maximum message size negotiation during the AMQP attach frame was handled incorrectly. The client now correctly sends a max message size of 0 (unlimited), allowing the server to apply its internal limit (20 MB) as intended.
2425

2526
### Other Changes
2627

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
OUTGOING_WINDOW,
4747
DEFAULT_AUTH_TIMEOUT,
4848
MESSAGE_DELIVERY_DONE_STATES,
49+
LINK_MAX_MESSAGE_SIZE
4950
)
5051

5152
from .management_operation import ManagementOperation
@@ -576,7 +577,7 @@ class SendClient(AMQPClient):
576577
def __init__(self, hostname, target, **kwargs):
577578
self.target = target
578579
# Sender and Link settings
579-
self._max_message_size = kwargs.pop("max_message_size", MAX_FRAME_SIZE_BYTES)
580+
self._max_message_size = kwargs.pop("max_message_size", LINK_MAX_MESSAGE_SIZE)
580581
self._link_properties = kwargs.pop("link_properties", None)
581582
self._link_credit = kwargs.pop("link_credit", None)
582583
super(SendClient, self).__init__(hostname, **kwargs)

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#: size until they have agreed a definitive maximum frame size for that Connection.
6060
MIN_MAX_FRAME_SIZE = 512
6161
MAX_FRAME_SIZE_BYTES = 1024 * 1024
62+
LINK_MAX_MESSAGE_SIZE = 0
6263
MAX_CHANNELS = 65535
6364
INCOMING_WINDOW = 64 * 1024
6465
OUTGOING_WINDOW = 64 * 1024

0 commit comments

Comments
 (0)