spring-projects / spring-projects/spring-data-redis
Overriding of redisCustomConversions is restricted [DATAREDIS-820]
@mp911de is already working on this.
Since Dec 30, 2020.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
James Green opened DATAREDIS-820 and commented
This is one of those "it was working last week I swear" issues.
We are storing a JSON formatted value in a hash and so need to override redisCustomConversions to add the plumbing. In a previous iteration we had two classes:
- RedisConfiguration. We added
@Configurationand@EnableRedisRepositories. Otherwise this class was empty. - SubscriptionsConfiguration. We added
@Configurationand a method annotated@Beanthat produced aCustomConversionsinstance namedredisCustomConversions.
Last Friday we noticed in local testing the results of the query were now blank. The logs indicated that the redisCustomConversions were ignored because there was already a bean with that name. I was unable to fix with @Order or @Priority.
As part of our stab-it-until-it-works-again measures we eventually moved the redisCustomConversations method into the RedisConfiguation class, and the local tests burst back to life.
So either there was something nasty on my dev workstation or there's a restriction requiring that bean to be declared within the class annotated @EnableRedisRepositories which I don't see documented. Either way some advice on whether this should be worked on as a bug / clarified in the docs, or "user error" would be good to see to wrap it up
Affects: 1.8.11 (Ingalls SR11)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.