How to keep state between app restarts? #250
-
Hi, I'm trying to learn how to integrate bucket4j on our API. One requisite is that I must keep the rate-limit state between app restarts. For example, if I define a limit of 1 calls per hour, deploying our app should not restart the rate-limit counters (even though the app itself will restart). Is there any simple path to fulfill this requisite? Any way to load/save the state from/to a file should work. Kind regards |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hello @lgfischer Do you to persist state only for graceful restart? What would you plan to do when your application crashed unexpectedly(as result bucket state is not persisted between restart)? |
Beta Was this translation helpful? Give feedback.
-
Hi @vladimir-bukhtoyarov, thank you for your help. I'm looking to save the rate-limit state every minute and before the app restart. We do daily deploys, so graceful app restarts are very common. Our app rarely crashes, and losing the last-minute state changes is acceptable in these cases. Kind regards |
Beta Was this translation helpful? Give feedback.
-
@lgfischer See: |
Beta Was this translation helpful? Give feedback.
@lgfischer
Discussed functionality has been released with version 7.5.0
See: