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.

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
@samvaity samvaity marked this pull request as ready for review December 10, 2025 22:12
Copilot AI review requested due to automatic review settings December 10, 2025 22:12
Copy link
Contributor

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 fixes three documentation errors related to incorrect or misleading usage of disableAutoComplete() in Service Bus code examples. The changes remove duplicate method calls, eliminate inappropriate usage with RECEIVE_AND_DELETE mode (where messages are auto-settled by the broker), and correct a misleading comment in the dead-letter queue example that claimed disableAutoComplete() was being used when it wasn't called.

Key Changes:

  • Removed duplicate disableAutoComplete() calls in PEEK_LOCK mode examples across all documentation
  • Removed disableAutoComplete() call and associated comment from RECEIVE_AND_DELETE mode examples (manual settlement not applicable in this mode)
  • Removed misleading comment about disableAutoComplete() in dead-letter queue example where the method wasn't actually called

Reviewed changes

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

Show a summary per file
File Description
ServiceBusReceiverClientJavaDocCodeSamples.java Removed misleading comment claiming disableAutoComplete is used in dead-letter queue example
ServiceBusProcessorClientJavaDocCodeSamples.java Removed duplicate disableAutoComplete() call in PEEK_LOCK example and removed call plus comment from RECEIVE_AND_DELETE example
package-info.java Removed duplicate disableAutoComplete() call in PEEK_LOCK example
ServiceBusProcessorClient.java Removed duplicate disableAutoComplete() call in PEEK_LOCK JavaDoc and removed call plus comment from RECEIVE_AND_DELETE JavaDoc
ServiceBusClientBuilder.java Removed duplicate disableAutoComplete() calls in PEEK_LOCK JavaDoc examples and removed call plus comment from RECEIVE_AND_DELETE JavaDoc examples
README.md Removed duplicate disableAutoComplete() call in PEEK_LOCK example and removed call plus comment from RECEIVE_AND_DELETE example, plus removed misleading comment in dead-letter queue example

@vinaysurya vinaysurya self-assigned this Dec 16, 2025
@vinaysurya vinaysurya self-requested a review December 16, 2025 20:51
@samvaity
Copy link
Member

samvaity commented Dec 17, 2025

/azp run check-enforcer override

@azure-pipelines
Copy link

Command 'check-enforcer' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

1 similar comment
@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@samvaity
Copy link
Member

/check-enforcer override

@samvaity samvaity merged commit 8f35cac into main Dec 17, 2025
30 of 31 checks passed
@samvaity samvaity deleted the copilot/fix-disable-autocomplete-examples branch December 17, 2025 20:04
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()

3 participants