Skip to content

[improve][pip] PIP-423: Add Support for Cancelling Individual Delayed Messages#8

Open
Denovo1998 wants to merge 10 commits into
masterfrom
pip-423
Open

[improve][pip] PIP-423: Add Support for Cancelling Individual Delayed Messages#8
Denovo1998 wants to merge 10 commits into
masterfrom
pip-423

Conversation

@Denovo1998

@Denovo1998 Denovo1998 commented Jun 1, 2025

Copy link
Copy Markdown
Owner

Motivation

In modern event-driven architectures, the ability to react to changing conditions is crucial. While Pulsar's delayed message feature is valuable for scheduling future tasks or deliveries, the lack of a cancellation mechanism presents a limitation. Use cases where cancellation is important include:

  • An order is placed with delayed processing, but the user cancels the order before processing begins.
  • A scheduled notification becomes obsolete due to a subsequent user action.
  • System alerts scheduled for future delivery are resolved before the delivery time.

Without a cancellation feature, applications might resort to workarounds, such as:

  • Consumers receiving and then filtering/ignoring obsolete delayed messages, which wastes processing resources and bandwidth.
  • Maintaining complex state management on the client-side to track and ignore messages, which is error-prone and doesn't prevent the message from being delivered by the broker.

This proposal aims to introduce a robust mechanism to cancel delayed messages directly at the subscription level, preventing their delivery if they are no longer needed.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: apache#24370

Copilot AI review requested due to automatic review settings November 9, 2025 09:58

Copilot AI left a comment

Copy link
Copy Markdown

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 PIP-423, a proposal for adding a new admin API to acknowledge/skip individual messages in Pulsar subscriptions by their specific MessageId.

  • Introduces a new REST API endpoint and CLI command to skip specific messages by their MessageId (ledgerId:entryId:batchIndex)
  • Leverages existing individual acknowledgement mechanisms for reliability
  • Supports both full entry and partial batch message acknowledgements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pip/pip-423.md
# the metadata store such as ZooKeeper.
managedCursorInfoCompressionType=NONE

# ManagedCursorInfo compression size threshold (bytes), only compress metadata when origin size more then this value.

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

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

Grammatical error: "more then" should be "more than".

Copilot uses AI. Check for mistakes.
Comment thread pip/pip-423.md
# in the metadata store such as ZooKeeper.
managedLedgerInfoCompressionType=NONE

# ManagedLedgerInfo compression size threshold (bytes), only compress metadata when origin size more then this value.

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

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

Grammatical error: "more then" should be "more than".

Copilot uses AI. Check for mistakes.
Comment thread pip/pip-423.md
This operation is local to a subscription's cursor within a single cluster. It has no direct impact on geo-replication. To skip a message on a replicated topic in multiple clusters, the admin command must be executed against each cluster individually.

# Alternatives

Copilot AI Nov 9, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The "Alternatives" section is empty. While this may be intentional, it's typically good practice to include at least a brief discussion of alternative approaches that were considered and why they were rejected, or explicitly state that no alternatives were considered.

Suggested change
The main alternative considered was to extend the existing `skip(numMessages)` API to allow skipping by `MessageId`. However, this approach was rejected because it would complicate the semantics of the existing API and could introduce ambiguity when skipping messages in batches or with delayed delivery. No other alternatives were identified that would provide the same level of precision and operational safety as the proposed admin API.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants