Dynamically update rate limit bandwidths #120
-
We have a feature request - we can initialize rate limit bandwidths from spring boot application.properties. However, if the need be from a rest endpoint we should be able to update the rate limit bandwidth which gets applied without restarting the application. Eg. increase the rate limit from 100 requests in 10 minutes to 200 requests in 10 minutes without restarting the application. Currently it is not allowed by just injecting the 'Bucket4JBootProperties' as 'bucket4JServletRequestFilterX' gets initialized when spring beans are loaded and there is no cleaner way of updating the 'ServletRequestFilter.filterConfig'. Even if we try to destroy and recreate 'bucket4JServletRequestFilterX' & 'Bucket4JAutoConfigurationServletFilter' beans after updating bandwidth in 'Bucket4JBootProperties', updated bandwidths doesn't get updated as 'final ConfigurationBuilder' instance in 'Bucket4JBaseConfiguration.buildFilterConfig()' doesn't get updated which is actually used for check. Your help is much appreciated to achieve updating bandwidths on the fly without restarting the application. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
Edwin9292 added this Feature in 0.10.2
https://github.com/MarcGiffing/bucket4j-spring-boot-starter?tab=readme-ov-file#dynamic_config_updates