BewareMyPower commented on issue #15176:
URL: https://github.com/apache/pulsar/issues/15176#issuecomment-1099839259
> Is this a long polling or short polling?
I think it should not be referred as "polling". In Pulsar, there is a
separated channel that receives messages from broker. The client only sends the
FLOW command to indicate that it needs more messages.
For example, after a consumer whose receiver queue size is 1000 is created,
it will send a FLOW request whose permits is 500, i.e. "I can cache 500
messages". Then how will broker dispatch messages is determined by the
implementation of the dispatcher. Another common case is that when a message is
received, the client will check the internal available permits and send a FLOW
request whose permits is 1 if necessary, i.e. "my receiver queue has over 500
available spots, please send messages".
> Repeat consumption might be introduced
I think repeated consumption is not related to polling. Let's talk about
Kafka, when a consumer sends multiple FETCH requests, the broker can process
them in order so that FETCH responses won't return overlapped messages.
The repeated consumption happens only when an offset is not committed
correctly while the consumer has already processed it. For example,
1. Consumer fetched "msg-0" and processed it.
2. Consumer committed offset 0.
3. There was a network issue and consumer restarted
4. Consumer restarted:
- If the offset has been committed successfully, the next message will be
"msg-1".
- Otherwise, the next message will be "msg-0".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]