Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 13, 2025

Description

Fixes three documentation errors in Service Bus code examples where disableAutoComplete() usage was incorrect or misleading:

  1. PEEK_LOCK example - Removed duplicate disableAutoComplete() call in builder chain
  2. RECEIVE_AND_DELETE example - Removed disableAutoComplete() call and comment (manual settlement is not applicable in RECEIVE_AND_DELETE mode)
  3. Dead-letter queue example - Removed comment claiming disableAutoComplete is used when it wasn't called

Before (PEEK_LOCK):

ServiceBusProcessorClient processorClient = new ServiceBusClientBuilder()
    .receiveMode(ServiceBusReceiveMode.PEEK_LOCK)
    .disableAutoComplete()
    .processMessage(processMessage)
    .processError(processError)
    .disableAutoComplete()  // Duplicate call
    .buildProcessorClient();

After:

ServiceBusProcessorClient processorClient = new ServiceBusClientBuilder()
    .receiveMode(ServiceBusReceiveMode.PEEK_LOCK)
    .disableAutoComplete()
    .processMessage(processMessage)
    .processError(processError)
    .buildProcessorClient();

Fixes documentation in README.md and corresponding JavaDoc code snippets across ServiceBusClientBuilder, ServiceBusProcessorClient, package-info, and sample classes.

Resolves https://github.com/MicrosoftDocs/azure-docs-sdk-java/issues/[issue_number]

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes. (N/A - documentation-only changes)
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes. (N/A - documentation-only changes)
Original prompt

This section details on the original issue you should resolve

<issue_title>confusing examples of disableAutoComplete()</issue_title>
<issue_description>### Type of issue

Typo

Description

The first example of a processorClient in the "Receive messages" section has two calls to disableAutoComplete() which seems incorrect.

The next example of a processorClient in that section still calls disableAutoComplete() even though receiveMode(ServiceBusReceiveMode.RECEIVE_AND_DELETE) is being set, which also seems unnecessary.

The example in the "Create a dead-letter queue Receiver" section has the following comment in the code

// 'disableAutoComplete' indicates that users will explicitly settle their message.

even though the disableAutoComplete() method isn't called in that example at all!

Page URL

https://learn.microsoft.com/en-us/java/api/overview/azure/messaging-servicebus-readme?view=azure-java-stable

Content source URL

https://github.com/MicrosoftDocs/azure-docs-sdk-java/blob/master/docs-ref-services/latest/messaging-servicebus-readme.md

Document Version Independent Id

fd464b71-5dbe-4863-0e02-76080c6d8ba3

Platform Id

9c322fb7-3a50-12ef-edc4-a9ee10975bad

Article author

@azure-sdk

Metadata

  • ID: 10341a8f-2866-d538-a11d-bb4f3dab8583
  • PlatformId: 9c322fb7-3a50-12ef-edc4-a9ee10975bad
  • Service: azure-service-bus</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: samvaity <16845631+samvaity@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix confusing examples of disableAutoComplete() Fix confusing disableAutoComplete() examples in Service Bus documentation Nov 13, 2025
Copilot AI requested a review from samvaity November 13, 2025 23:44
Copilot finished work on behalf of samvaity November 13, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

confusing examples of disableAutoComplete()

2 participants