Skip to content

Conversation

@Denovo1998
Copy link
Owner

@Denovo1998 Denovo1998 commented Jun 1, 2025

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

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