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

patch: add multiple conditionals to prevent Bean clashes #91 #92

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

rspiegl
Copy link
Contributor

@rspiegl rspiegl commented Jan 14, 2024

Fixes #91 by only creating default Beans if nothing is provided by the user.
session.store-type was removed in Spring Boot 3 (look at spring-projects/spring-boot#27756) and so I have removed it here as well.

Adds UnitTests to make sure that creation of default Beans is backed off in case there exists a Bean.

@rspiegl rspiegl self-assigned this Jan 14, 2024
@ghost
Copy link

ghost commented Jan 14, 2024

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@rspiegl
Copy link
Contributor Author

rspiegl commented Jan 15, 2024

One inconvenience has popped up during further testing:

2024-01-15T16:20:54.414+01:00 WARN 10928 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.cloudflight.platform.spring.caching.autoconfigure.CachingAutoConfiguration$RedisConfiguration' of type [io.cloudflight.platform.spring.caching.autoconfigure.CachingAutoConfiguration$RedisConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [meterRegistryPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2024-01-15T16:20:54.426+01:00 WARN 10928 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'errorHandler' of type [io.cloudflight.platform.spring.caching.RedisCacheErrorHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [meterRegistryPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.

need to look into how to fix it

@rspiegl rspiegl force-pushed the rspiegl/91/fix-redis branch from d55d38e to c5df5b2 Compare January 15, 2024 16:22
@rspiegl
Copy link
Contributor Author

rspiegl commented Jan 15, 2024

I've fixed it by adding @ConditionalOnBean(RedisConnectionFactory::class) to the CachingConfigurer Configuration. Somehow the errorHandler needs this dependency. I could have split it up further but logically it makes sense to stay there.

@rspiegl rspiegl force-pushed the rspiegl/91/fix-redis branch 3 times, most recently from 8ba519b to 1fb6a3d Compare January 22, 2024 09:09
@rspiegl rspiegl force-pushed the rspiegl/91/fix-redis branch from 1fb6a3d to 127402e Compare January 23, 2024 16:39
README.md Outdated Show resolved Hide resolved
@rspiegl rspiegl merged commit 516b7d9 into master Feb 7, 2024
2 checks passed
@rspiegl rspiegl deleted the rspiegl/91/fix-redis branch February 7, 2024 14:48
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

Successfully merging this pull request may close these issues.

RedisSessionRepository clash
2 participants