spring-projects / spring-projects/spring-data-redis

Overriding of redisCustomConversions is restricted [DATAREDIS-820]

Open
#1,393 3 comments 0 reactions 1 assignee View on GitHub

@mp911de is already working on this.

Since Dec 30, 2020.

in: core type: bug
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:

  1. RedisConfiguration. We added @Configuration and @EnableRedisRepositories. Otherwise this class was empty.
  2. SubscriptionsConfiguration. We added @Configuration and a method annotated @Bean that produced a CustomConversions instance named redisCustomConversions.

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.