You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KeyValueRepositoryConfigurationExtension (enabled through @EnableMapRepositories or @EnableRedisRepositories) attempts to create default beans if there are no bean definitions already registered. This happens mostly for KeyValueTemplate and the MappingContext.
For Redis, there are a couple more beans involved. When using multiple configuration classes, the processing of KeyValueRepositoryConfigurationExtension depends on the actual order in which bean registrations are been made. Defining a template bean in one config class and declaring @EnableMapRepositories on a different class can lead to the state where KeyValueRepositoryConfigurationExtension does not yet see the bean declaration and thus two beans get registered.
We should back off from this type of defaulting and ideally try to reduce the number of required beans. Besides that, we should investigate a configuration model that tries to supply missing beans/components through a BeanPostProcessor.
In the case of Map repositories:
Check whether a KeyValueRepositoryFactoryBean is associated with a MappingContext/QueryCreator/KeyValueOperations prior to bean initialization so that defaulting applies as late as possible.
The text was updated successfully, but these errors were encountered:
KeyValueRepositoryConfigurationExtension
(enabled through@EnableMapRepositories
or@EnableRedisRepositories
) attempts to create default beans if there are no bean definitions already registered. This happens mostly forKeyValueTemplate
and theMappingContext
.For Redis, there are a couple more beans involved. When using multiple configuration classes, the processing of
KeyValueRepositoryConfigurationExtension
depends on the actual order in which bean registrations are been made. Defining a template bean in one config class and declaring@EnableMapRepositories
on a different class can lead to the state whereKeyValueRepositoryConfigurationExtension
does not yet see the bean declaration and thus two beans get registered.We should back off from this type of defaulting and ideally try to reduce the number of required beans. Besides that, we should investigate a configuration model that tries to supply missing beans/components through a
BeanPostProcessor
.In the case of Map repositories:
Check whether a
KeyValueRepositoryFactoryBean
is associated with aMappingContext
/QueryCreator
/KeyValueOperations
prior to bean initialization so that defaulting applies as late as possible.The text was updated successfully, but these errors were encountered: