Skip to content

Implement ReconsumeLater on regex consumer - #1456

Merged
BewareMyPower merged 7 commits into
apache:masterfrom
jordanfitz:regex-consumer-reconsumelater
Jan 18, 2026
Merged

BewareMyPower merged 7 commits into
apache:masterfrom
jordanfitz:regex-consumer-reconsumelater

Conversation

@jordanfitz

Copy link
Copy Markdown
Contributor

Motivation

Currently, ReconsumeLater and ReconsumeLaterWithCustomProperties are unimplemented on regexConsumer. From what I can tell, these appear to just be missing methods rather than some fundamental limitation of the consumer implementation. Hopefully I'm correct there.

Modifications

I've essentially copied over the ReconsumeLaterWithCustomProperties implementation from multiTopicConsumer. I ran into the problem that the current code to add the RLQ topic to the consumer's Topics slice doesn't take into account subscriptions defined by TopicsPattern. To address this, I (perhaps naively) append the RLQ topic to the slice returned by regexConsumer.topics().

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Added a test to ensure that a call to ReconsumeLater on a regex-based consumer causes the message to be published to the RLQ.

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

  • Dependencies (does it add or upgrade a dependency): No
  • The public API: No
  • The schema: No
  • The default values of configurations: No
  • The wire protocol: No

Documentation

  • Does this pull request introduce a new feature? No
  • If yes, how is the feature documented? N/A
  • If a feature is not applicable for documentation, explain why? The behavior of the newly-implemented method should be the same as the existing consumer implementations.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements the previously unimplemented ReconsumeLater and ReconsumeLaterWithCustomProperties methods for the regex consumer. The implementation follows the pattern used by multiTopicConsumer, delegating the reconsume operation to the appropriate topic-specific consumer. To support this, the PR also modifies the topics() method to include the retry letter topic in the list of topics when retry is enabled.

Changes:

  • Implemented ReconsumeLater and ReconsumeLaterWithCustomProperties methods for regexConsumer
  • Modified topics() method to append the retry letter topic when RetryEnable is true
  • Added integration test to verify ReconsumeLater functionality with regex consumers

Reviewed changes

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

File Description
pulsar/consumer_regex.go Implements ReconsumeLater methods and updates topics() to include retry topic
pulsar/consumer_regex_test.go Adds integration test for ReconsumeLater with regex consumers

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

Comment thread pulsar/consumer_regex.go Resolved
Comment thread pulsar/consumer_regex.go Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


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

Comment thread pulsar/consumer_regex.go Resolved
Comment thread pulsar/consumer_regex.go Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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


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

Comment thread pulsar/consumer_regex.go Resolved
Comment thread pulsar/consumer_regex_test.go Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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


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

@crossoverJie crossoverJie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@BewareMyPower
BewareMyPower merged commit cc18590 into apache:master Jan 18, 2026
13 checks passed
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.

4 participants