You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/01/06 16:50:12 UTC

[GitHub] [pulsar] klevy-toast opened a new issue #9141: Message redelivery delay with exponential back-off

klevy-toast opened a new issue #9141:
URL: https://github.com/apache/pulsar/issues/9141


   **Is your feature request related to a problem? Please describe.**
   I would like to leverage re-deliveries with exponential back-off when my consumer nacks a message. Retries with exponential back-off is often preferred over simple retries when encountering transient errors to give an immediate chance at succeeding on a retry, but to avoid overwhelming a service if it is failing a lot of messages.
   
   **Describe the solution you'd like**
   Allow configuration of a retry strategy (fixed interval, exponential back-off) when configuring redelivery delay.
   
   **Describe alternatives you've considered**
   I think that this could be hacked together in the consumer code, by checking the delivery count and scheduling one-off redeliveries based on that, but it would be a much more fragile solution.
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-788556961


   @klevy-toast Yes, It seems reasonable to me. Are you interested in pushing a PR for this issue?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] klevy-toast closed issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
klevy-toast closed issue #9141:
URL: https://github.com/apache/pulsar/issues/9141


   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] klevy-toast commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
klevy-toast commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-771739313


   > @klevy-toast You are right, the PIP-58 is e enough to manually implement the back-off logic. It's easy to support exponential back-off for the redelivery since we have exposed the redelivery count to the client-side.
   
   @codelipenghui would it be reasonable to create a retry strategy as I described, so that many pulsar users could quickly utilize exponential back-off without re-implementing the logic every time?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] sijie commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-756581177


   @klevy-toast did you checkout https://pulsar.apache.org/docs/en/concepts-messaging/#retry-letter-topic?
   
   https://github.com/apache/pulsar/wiki/PIP-58-%3A-Support-Consumers--Set-Custom-Retry-Delay


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] klevy-toast commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
klevy-toast commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-970443513


   close by https://github.com/apache/pulsar/pull/12566 


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] alivannikov commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
alivannikov commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-808142531


   Hi all!
   
   We are also interested in redelivery delay with exponential back-off feature, and while investigating possible ways to implement it I got a bit confused by different existing options and mechanisms. In particular - what is the relation between `reconsumeLater` api and `nacking`? Let's pretend I just want fixed retry delay. Is there any difference between
   a. Configuring `NackRedeliveryDelay` option and sending `Nack`
   b. Using `reconsumeLater` with same `NackRedeliveryDelay`
   
   One more follow-up question. If I call `reconsumeLater`, do I need to send `Ack` after it? (in some sense I processed message to some result - rescheduling) `Nack`? Nothing?


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] klevy-toast commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
klevy-toast commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-771739313


   > @klevy-toast You are right, the PIP-58 is e enough to manually implement the back-off logic. It's easy to support exponential back-off for the redelivery since we have exposed the redelivery count to the client-side.
   
   @codelipenghui would it be reasonable to create a retry strategy as I described, so that many pulsar users could quickly utilize exponential back-off without re-implementing the logic every time?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-770234455


   @klevy-toast You are right, the PIP-58 is e enough to manually implement the back-off logic. It's easy to support exponential back-off for the redelivery since we have exposed the redelivery count to the client-side. 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] alivannikov commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
alivannikov commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-812479226


   @codelipenghui Thank you for reply. One more point regarding the issue.
   
   > It's easy to support exponential back-off for the redelivery since we have exposed the redelivery count to the client-side.
   
   While this is true for `Nack` case, which really increments the counter, `reconsumeLater` flow actually `Ack` original message under the hood and uses internal map structure to track the counter. For me redelivery count exposed by api was always 0 while testing `reconsumeLater`. I was reading real counter from message properties map by `SysPropertyReconsumeTimes` (Go client, similar property exists in Java client) key.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] klevy-toast commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
klevy-toast commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-756880001


   Thanks @sijie -- I had not seen the retry-letter-topic. I am having a little trouble picture how it could be utilized for exponential back-off -- would I want to configure the consumer to have a single immediate, retry, and then the retry topic to have a higher delay? How would that delay be configured?
   
   The PIP-58 proposal looks more similar to what I am imagining, without the use of additional topic. It would be even nicer to have pre-configured retry "strategies" (I believe that the AWS Java SDK has this concept), but a `reconsumeLater` would probably be enough to manually implement the back-off logic.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] klevy-toast commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
klevy-toast commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-756880001


   Thanks @sijie -- I had not seen the retry-letter-topic. I am having a little trouble picture how it could be utilized for exponential back-off -- would I want to configure the consumer to have a single immediate, retry, and then the retry topic to have a higher delay? How would that delay be configured?
   
   The PIP-58 proposal looks more similar to what I am imagining, without the use of additional topic. It would be even nicer to have pre-configured retry "strategies" (I believe that the AWS Java SDK has this concept), but a `reconsumeLater` would probably be enough to manually implement the back-off logic.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] klevy-toast commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
klevy-toast commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-801215940


   @codelipenghui sure, although it may take me a while to find the spare cycles.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-809412251


   The recosumeLater can works while the client crashes, if use the nack delay and the client crashes at a time, the message will retry immediately.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] sijie commented on issue #9141: Message redelivery delay with exponential back-off

Posted by GitBox <gi...@apache.org>.
sijie commented on issue #9141:
URL: https://github.com/apache/pulsar/issues/9141#issuecomment-758421710


   @codelipenghui Can you take a look at this?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org