Skip to content

Configuration replacement not working as expected #481

Discussion options

You must be logged in to vote

Hello @mapoallegro

Explanation

The replacement is working only when bucket is persisted in Redis, after TTL time (bucket removed from Redis) the configuration is reverted to original one.

The explanation is simple:

  1. Config always stored together with bucket state.
  2. After replaceConfigureation had called new config was stored in Redis.
  3. After expiration happen, both config and bucket state were removed by Redis itself.
  4. On next tryConsume Bucket4j had detected the lack of bucket, then it asked config supplier for configuration.
  5. Because your configSupplier is constant, it had returned legacy config, so bucket was recreated with legacy config.

How to fix?

First of all, you use deprecated met…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mapoallegro
Comment options

@vladimir-bukhtoyarov
Comment options

@mapoallegro
Comment options

@vladimir-bukhtoyarov
Comment options

Answer selected by mapoallegro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants