2

I am using couchbase as DB and Redis for caching purposes in my application.

However, I am not able to make it work. The application throws the following error during startup.

No qualifying bean of type 'org.springframework.data.convert.CustomConversions' available: expected single matching bean but found 2: couchbaseCustomConversions,redisCustomConversions

How can i resolve this? Please help

Shamil Puthukkot
  • 442
  • 2
  • 17
  • It's confusing to me that you'd use Redis as a cache in front of Couchbase, when Couchbase itself can also act as a cache (it has both memory-first and memory-only options). I know this doesn't answer your question, but I'm just curious about the 'why' – Matthew Groves Mar 02 '21 at 14:37
  • 1
    I don't use the enterprise version of couchbase which gives the in-memory ephemeral buckets. – Shamil Puthukkot Mar 02 '21 at 14:59
  • 1
    Can the couchbase buckets act as a cache?My use case is very simple. I just wanted to use some key-value pairs, no caching of documents or method results or any such stuff – Shamil Puthukkot Mar 02 '21 at 15:09
  • 2
    Ephemeral is "memory only", but regular Couchbase buckets still have a memory-first cache built in. And especially for just caching simple key-value pairs. I'm not here to tell you how to architect your solution, you know it better than me, but it seems redundant to use a cache like Redis in front of something like Couchbase that already has a built-in cache. – Matthew Groves Mar 02 '21 at 16:29

1 Answers1

1

Adding a custom bean definition in the couchbaseconfiguration class,i.e the class which extends AbstractCouchbaseConfiguration would solve the issue.

@Bean
    public CustomConversions customConversions() {
        return super.customConversions();
    }
Shamil Puthukkot
  • 442
  • 2
  • 17