apache / apache/pulsar

In ReconsumeLater interface, support level increment delay

Open
#11,892 1 comment 0 reactions 1 assignee Claimed by @wolfstudy View on GitHub
lifecycle/stale type/feature
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

**Is your feature request related to a problem? Please describe.**

At present, ReconsumrLater only supports specifying a specific delay time for distribution processing. If we can here follow a certain delay level from low to high and allow it to automatically retry, it is a more user-friendly way. For example, we can define the following delay level:

```
MESSAGE_DELAYLEVEL = "1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h"
```

Here we can expose two interfaces to the user:

one:
This implementation method is consistent with the current reconsumeLater interface, but instead of specifying the delay level, specify the specific delay time. For example, level 1 corresponds to 1s, and level 3 corresponds to 10s.

```
reconsumeLater(msg, 1)
```

two:

Different from the above two, it is a back-off retry, that is, the retry interval after the first failure is 1 second, and the retry interval after the second failure is 5 seconds, and so on, the more the number of times, the longer the interval.

This kind of retry mechanism often has more practical applications in business scenarios. If the consumption fails, the general service will not be restored immediately. It is more reasonable to use this gradual retry method.

```
reconsumeLater(msg)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.