Skip to content

[Messaging]: MessageFlux: adding a retry const that limit retry to terminal completion event #45400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 20, 2025

Conversation

anuchandy
Copy link
Member

@anuchandy anuchandy commented May 19, 2025

Originally in legacy V1 stack, the Event Hubs partition receiver used to retry on link "termination by completion" but propagates "terminal error". See the V1 code here on completion retry.

In V2 stack, we let both terminal events (completion, error) to get propagated. While it makes sense to propagate the "terminal error" like in V1 (e.g. ownership lost error), propagating "terminal completion" seems not a great user experience. For example, terminal completion will terminate the partition pump used by the Event Hub Processor, which means load balancer cycle is needed to acquire (claim) that partition again.

This PR changes this behavior to have retry on completion like legacy code.

@anuchandy anuchandy self-assigned this May 19, 2025
@Copilot Copilot AI review requested due to automatic review settings May 19, 2025 22:35
@anuchandy anuchandy changed the title [Messaging]: MessageFlux: adding a retry const that when used limit retry to terminal completion event [Messaging]: MessageFlux: adding a retry const that limit retry to terminal completion event May 19, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new retry policy (RETRY_ONLY_COMPLETION) that retries only on terminal completion events and applies it to V2 MessageFlux consumers, while bumping the azure-core-amqp dependency version.

  • Adds MessageFlux.RETRY_ONLY_COMPLETION policy and plugs it into V2 consumer constructors and tests.
  • Updates Service Bus and Event Hubs pom.xml files to azure-core-amqp:2.10.0-beta.1.
  • Registers the new version in eng/versioning/version_client.txt.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk/servicebus/azure-messaging-servicebus/pom.xml Bumped azure-core-amqp to 2.10.0-beta.1
sdk/eventhubs/azure-messaging-eventhubs/pom.xml Bumped azure-core-amqp to 2.10.0-beta.1
eng/versioning/version_client.txt Added unreleased_com.azure:azure-core-amqp;2.10.0-beta.1
sdk/core/azure-core-amqp/src/main/java/.../MessageFlux.java Introduced RETRY_ONLY_COMPLETION and its handling logic
sdk/eventhubs/.../EventHubPartitionAsyncConsumerTest.java Switched test to use RETRY_ONLY_COMPLETION
sdk/eventhubs/.../EventHubConsumerAsyncClient.java Switched client to use RETRY_ONLY_COMPLETION
Comments suppressed due to low confidence (2)

sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubPartitionAsyncConsumerTest.java:331

  • Add unit tests to verify that under RETRY_ONLY_COMPLETION, the flux retries on completion but terminates on an error. Currently only the policy switch is tested, not its behavior.
CreditFlowMode.EmissionDriven, MessageFlux.RETRY_ONLY_COMPLETION);

sdk/servicebus/azure-messaging-servicebus/pom.xml:75

  • [nitpick] Verify that the {x-version-update;...} marker matches the groupId:artifactId used by your versioning automation (should it be com.azure:azure-core-amqp instead of unreleased_com.azure:azure-core-amqp?).
<version>2.10.0-beta.1</version> <!-- {x-version-update;unreleased_com.azure:azure-core-amqp;dependency} -->

Copy link
Member

@conniey conniey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test? Thank you Anu!

@anuchandy
Copy link
Member Author

Adding tests in a follow up pr, along with few other logging changes.

@anuchandy anuchandy merged commit b4aba83 into Azure:main May 20, 2025
60 checks passed
@anuchandy
Copy link
Member Author

UT added in the pr #45416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants