Commit 1563ae1
[Service Bus] Fix batch send of messages with routing properties (#47625)
* [Service Bus] Fix batch send of messages with routing properties
Sending a batch of messages with message_id, session_id, or partition_key
set raised TypeError ("'BatchMessage' object is not subscriptable") on the
uamqp transport, and surfaced a secondary AttributeError on the list send
path.
- Route batch-envelope property capture through a new transport abstraction
(set_batch_envelope_properties) with pyamqp and uamqp implementations, so
routing properties land on the AMQP batch envelope on both transports.
- Discriminate the batch path from the single-message path with an explicit
isinstance(list) check instead of a broad except TypeError that masked the
real error.
- Add unit coverage for the envelope capture on both transports and for the
list-vs-single discriminator contract.
Regression from #42598.
* fix: Use inline pylint disable for protected-access in batch send
- pylint 4.0.4 does not honor a standalone disable comment inside an else
suite (only inside an except suite), so converting the try/except to
if/else left two protected-access warnings on _message unsuppressed
- Move the disable inline onto the _message accesses in both sync and
async ServiceBusSender.send_messages, matching the existing file
convention
* chore(servicebus): add api.md and api.metadata.yml for API review gate
---------
Co-authored-by: Eldert Grootenboer (from Dev Box) <egrootenboer@microsoft.com>1 parent af64603 commit 1563ae1
10 files changed
Lines changed: 2264 additions & 19 deletions
File tree
- sdk/servicebus/azure-servicebus
- azure/servicebus
- _common
- _transport
- aio
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
0 commit comments