Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use nondurable cursors for pulsar readers #324

Merged

Conversation

omegaphoenix
Copy link
Contributor

@omegaphoenix omegaphoenix commented Aug 22, 2024

From the Apache Pulsar documentation:

Internally, the reader interface is implemented as a consumer using an exclusive, non-durable subscription to the topic with a randomly-allocated name.

By default we set subscriptions to use a durable cursor:
https://github.com/streamnative/pulsar-rs/blob/master/PulsarApi.proto#L352

We only run into this when durable is None which can also be avoided
if we use Pulsar::reader() which also sets durable to Some(false).

However, there are cases where users may overwrite the options before
calling into_reader().

By default we set subscriptions to use a durable cursor:
https://github.com/streamnative/pulsar-rs/blob/master/PulsarApi.proto#L352

We only run into this when durable is None which can also be avoided
if we use Pulsar::reader() which also sets durable to Some(false).

However, there are cases where users may overwrite the options before
calling `into_reader()`.
@omegaphoenix
Copy link
Contributor Author

Screenshot 2024-08-22 at 4 57 52 PM
An example of how we could shoot ourselves in the foot without this change

@BewareMyPower BewareMyPower merged commit a4012e8 into streamnative:master Aug 23, 2024
5 checks passed
@omegaphoenix omegaphoenix deleted the feature/non-durable-readers branch August 23, 2024 04:21
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.

2 participants