Azure / Azure/azure-sdk-for-rust

[AMQP] Receiver cannot send Modified or annotated Rejected dispositions

Open
#4,935 0 comments 1 reaction 0 assignees View on GitHub
Azure.Core Client
Dominant language
Rust
Stars
884
Forks
365
Avg merge
2d 19h
Merged PRs (30d)
109

Description

## Summary

`AmqpReceiverApis` in `sdk/core/azure_core_amqp/src/receiver.rs` exposes only `accept_delivery`, `reject_delivery`, and `release_delivery`. There is no way to settle a delivery with an AMQP `Modified` outcome, and `reject_delivery` accepts no error condition or description.

## Motivation

Service Bus needs four settlement dispositions and three distinct AMQP outcomes. Abandon is `Modified` with `undeliverable-here` set to false. Defer is `Modified` with `undeliverable-here` set to true. Dead letter is `Rejected` with a reason and a description. None of the three can be expressed today.

The effect on `azure_messaging_servicebus` is silent data loss. `Receiver::abandon_message` calls `release_delivery` and drops `properties_to_modify`. `Receiver::dead_letter_message` calls `reject_delivery` and drops `reason`, `error_description`, and `properties_to_modify`. The caller receives `Ok(())` in both cases.

`AmqpOutcome::Modified` already exists in `sdk/core/azure_core_amqp/src/messaging.rs`, but it describes a send outcome. No receiver side API applies it.

## Proposal

Extend `AmqpReceiverApis` so a delivery can be settled with the full AMQP outcome set.

- Add a `Modified` disposition that carries `delivery-failed`, `undeliverable-here`, and `message-annotations`.
- Give the `Rejected` disposition an error condition and an optional description.
- Keep the existing three methods, or replace them with one disposition method that takes an outcome. Pick whichever fits the crate's stability guarantees.

Sub-issue of #4934.

Contributor guide

Open the contributing guide

Research direction

Start with sdk/core/azure_core_amqp/src/receiver.rs and compare its settlement methods with AmqpOutcome::Modified in sdk/core/azure_core_amqp/src/messaging.rs. Trace abandon_message and dead_letter_message in azure_messaging_servicebus to understand the dropped fields. Done means receiver settlement can express Modified and Rejected outcomes with the specified fields and callers no longer silently discard them.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.