Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve overall spring-boot-starter experience + interop with spring-boot-starter-data-redis #210

Open
Brutus5000 opened this issue Dec 15, 2023 · 0 comments

Comments

@Brutus5000
Copy link

Brutus5000 commented Dec 15, 2023

So as a dummy for both bucket4j and redis I had massive failstart with this spring boot starter (0.8.1 due to limited to Spring Boot 2.7 for the moment).
Please do not take this as a rant but as a list of pains and a starting point for improvement.

So my expectation of any Spring Boot Starter (including this one) is:

  1. I do not need to declare my own beans, as they are loaded from my application properties
  2. If I provide my own bean, the starter bean is not loaded (@ConditionalOnMissingBean)
  3. There are sensible defaults for the properties (ports=default port, ip=localhost)
  4. If there aren't sensible default properties possible and I do not provide the required ones it fails to boot with an error message.
  5. Spring Boot starters complement each other if possible

What I encountered in this Spring Boot starter is quite different:

  1. Each Redis configuration I looked at required to declare some kind of Redis connection bean
  2. The required connection information for the beans in 1. where not read from application properties
  3. There are no properties regarding the redis connection here as it seems.
  4. Because of the missing beans - despite configuring a dedicated redis backend - the application launched but did not load the configuration at all with no errors being logged. I had to debug log through bean configuration to figure out why the different Configurations (I tried lettuce, jedis, springdata, ...) did not load. Especially in combination with Readme: (Redis) reactive hints not idiot proof #208 this can lead to frustration.
  5. The spring-boot-starter-data-redis can provide either lettuce or jedis configuration. Nevertheless this library does not take these into account and demands either it's own Jedis pool (problem: the redis starter creates a pool but does not make it available as a bean) or a lettuce RedisClient which is also not provided as a bean (maybe it did in the past? I can't tell).
    It would be nice if these could be interoperable. For the now removed (see Why was support for redis-springdata removed in 0.10.1? #209) RedisSpringDataBucket4jConfiguration instead of a @ConditionalOnBean(RedisCommands.class) it seem would have been sufficient to require a redisConnectionFactory instead (?).

So from a technical point of view it's hard to me to evaluate why things are the way they are. Maybe there are good reasons. Depending on the feedback I might be able to throw in a PR or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant