-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Position Reader on a specific message within a batch #720
Conversation
retest this please |
&& messageId.getEntryId() == startMessageId.getEntryId() | ||
&& i <= startMessageId.getBatchIndex()) { | ||
// If we are receiving a batch message, we need to discard messages that were prior | ||
// to the startMessageId |
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.
just a quick suggestion if that make sense.
- what if we also add similar validation at
messageReceived()
for non-batch-msg also where we skip the message ifreceivedMsgId < startMessageId
- and at broker we always read from
entryId=entryId-1
and duplicate entry will be anyway skipped by the client.
In this way, broker can be BatchMessage
agnostic and it will not have any batch-msg specific logic as it treats batch-msg as normal msg only.
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.
I think that checking everything in client side gets a bit more complicated for the comparison. Also we'd have to do it in 2 places one for batch messages and one for regular. Plus in C++ and Java.
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.
I think that checking everything in client side gets a bit more complicated for the comparison.
Oh. Other than adding skip-condition for non-batch msg, do we have to do anything additionally? My take would be, handling duplicate msg at client (because anyway we are doing for batch-msg so, why not for normal msg) is better than adding small-hack at broker.
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.
Uhm, I still prefer doing it in server side :)
What about encapsulating in the MessageIdImpl
so that we can have a method to get the "right" message id and that method can be overriden in the BatchMessageIdImpl
class?
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.
Uhm, I still prefer doing it in server side :)
Alright.. 👍
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.
👍
retest this please |
672c044
to
f70c868
Compare
f70c868
to
7f2332c
Compare
Motivation
Allow the Topic reader to position on a particular message within a batch.