Skip to content

[feat][broker] Expose configuration to allow to read marker type messages#25171

Open
zymap wants to merge 1 commit intoapache:masterfrom
zymap:allow-to-rawReader-read-marker
Open

[feat][broker] Expose configuration to allow to read marker type messages#25171
zymap wants to merge 1 commit intoapache:masterfrom
zymap:allow-to-rawReader-read-marker

Conversation

@zymap
Copy link
Member

@zymap zymap commented Jan 21, 2026

Fixes #xyz

Main Issue: #xyz

PIP: #xyz

Motivation

When using RawReader to read messages, we want to read all the messages from the broker. And handle the marker type on the reader side.

Modifications

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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:

…ages

---

### Motivation

When using RawReader to read messages, we want to read all the messages
from the broker. And handle the marker type in the reader side.
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 21, 2026
Comment on lines +4024 to +4027
doc = "For some use case like compaction, raw reader want to read all the data from the topics and handle the "
+ "marker by the reader. It needs to skip the marker check to delivery the message to the consumer. "
+ "This configuration allows to configure a subscription prefix, the the reader which has the prefix "
+ "will receive all the data."
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: "the the reader…"

PulsarClient client2 = PulsarClient.builder().serviceUrl(url2.toString())
.statsInterval(0, TimeUnit.SECONDS).build();

var reader = RawReader.create(client2, topicName, subName).get();
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to close, please use try-with-resources.

producer.newMessage(txn).value("message-1").send();
txn.commit().get();

var reader = RawReader.create(pulsarClient, topic, "__supervisor-01").get();
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to close, please use try-with-resources.

return true;
}
for (String prefix : serviceConfig.getSubscriptionPrefixToSkipServerMarkerCheck()) {
if (name.startsWith(prefix)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If paired with "" (empty string), startsWith("") will allow all subscriptions to receive the marker.

If paired with "__", it might cause many internal subscriptions to receive the marker.

Here these two need to be ignored?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants