-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
makes subscription start from MessageId.latest defaultly #9444
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aloyszhang the change looks good. Can you add a test case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @aloyszhang, I think the root cause is that we haven't handled the messageId correctly. I left a comment here #9441 (comment).
@zymap Yes, you're right, I'll check this later and add some test code. |
@zymap So far, I didn't find a way to handle a Do you have any idea about this? |
Since this PR does not resolve issue #9441, so remove the |
/pulsarbot run-failure-checks |
@aloyszhang I think there has an easier way is add query params at this API and allow it to pass a message position string. If the user only specifies the message position with a string in the query params, we can use it to create a cursor. Otherwise, we can use the current logic to handle it. For example, if a request URL likes this:
We can create a subscription from the latest position if a request URL likes this:
We can use current logic to handle it. |
@zymap Thanks for your suggestions.
Only one thing need to be figured out, if the request have boths |
/pulsarbot run-failure-checks |
@zymap Can you review it again? |
### Motivation Currently , if we did not specify the position when create a new subscription, it's will use the earliest position defaulty. https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java#L2002 This PR makes subscription start from MessageId.latest defaultly (cherry picked from commit 28b2094)
Motivation
Currently , if we did not specify the position when create a new subscription, it's will use the earliest position defaulty. https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java#L2002
This PR makes subscription start from MessageId.latest defaultly