如何实现Spring Boot中的Redis多租户?

huangapple go评论49阅读模式
英文:

How to implement spring boot Redis multi tenancy?

问题

我在使用Spring Boot和Redis创建多租户应用时遇到了问题。我使用了与如何在Spring Boot中实现Redis多租户中提到的相同解决方案,但没有成功。是否有一种不同的方法来在Spring Boot中实现Redis多租户?

英文:

I am facing issues while creating a Multitenant application using spring boot and Redis. I have used the same solution which is mentioned in How to implement multitenancy for Redis in spring boot. But it didn't work. Is there a different way to implement Redis multitenancy with Spring boot.

答案1

得分: 1

我通过添加一个检查,如果数据源不在缓存中,则从所需的源中获取并创建连接,找到了解决方案。还明确更改了调用 afterPropertiesSet(),如https://stackoverflow.com/questions/59661914/how-to-implement-multitenancy-for-redis-in-spring-boot/59676369#59676369 中所述。

英文:

I found the solution by adding a check if the data source not available in the cache then pull from the required source and create a connection. Also changed calling afterPropertiesSet() explicitly which is mentioned in https://stackoverflow.com/questions/59661914/how-to-implement-multitenancy-for-redis-in-spring-boot/59676369#59676369

huangapple
  • 本文由 发表于 2020年7月31日 16:49:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/63188663.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定