![](/img/trans.png)
[英]More than 1 caching storage in spring boot app
我面臨一個奇怪的問題 - 我的項目中有 hazelcast 和 redis。 突然間,所有@Cacheable注釋都只將條目放入 hazelcast 緩存,即使特定的緩存名稱是通過 redis 緩存構建器配置的: 使用緩存: 兩者都不起作用,只能將請求轉發給 hazelcast。 如何解決這個問題? ...
[英]More than 1 caching storage in spring boot app
我面臨一個奇怪的問題 - 我的項目中有 hazelcast 和 redis。 突然間,所有@Cacheable注釋都只將條目放入 hazelcast 緩存,即使特定的緩存名稱是通過 redis 緩存構建器配置的: 使用緩存: 兩者都不起作用,只能將請求轉發給 hazelcast。 如何解決這個問題? ...
[英]How to use cache with Google Sheets in Spring Boot?
我剛剛開始學習 Spring Boot 並嘗試將緩存與 Google 表格 API 一起使用來學習 Springboot。 要在 Spring Boot 中將緩存與 Google 表格一起使用,我在我的 pom.xml 文件中添加了 spring-boot-starter-cache 依賴項,並通 ...
[英]Is an explicit CacheManager bean definition mandatory when using Spring Boot + Spring Cache?
來自文檔 Spring 如果我們不定義自己的 CacheManager bean 定義,Boot 默認使用 ConcurrentMapCacheManager 作為 CacheManager 實現。 但是我不斷收到“沒有可用的'org.springframework.cache.CacheMana ...
[英]No qualifying bean of type 'feign.Client' available being thrown in the background
我的應用程序后台拋出異常。 該錯誤未記錄,但被稱為 Dynatrace 的第三方工具捕獲,由於使用此工具,我們能夠看到以下異常。 我們正在使用 Java 11 和依賴項: spring-boot-starter-parent 2.7.5 彈簧雲依賴 2021.0.5 spring-boot-s ...
[英]Why does Hazelcast not show entry in the Map when added via CachePut/Cacheable
我有一個用例,其中通過 @CachePut 注釋向緩存添加了一個條目,我必須手動檢索它(通過代碼)。 我可以看到總備份計數給我的條目數為 1,但所有地圖給我的大小為 0。所以,我不確定我做錯了什么。 這是我的代碼 HazelcastConfig.java TestServiceImpl.java ...
[英]Can we first validate the existing data in the cache then go for the missing keys in Spring Boot Cache?
我想從表中獲取數據。 表名:學生 我有疑問: 需要:當我調用存儲庫 student findByIdIn(:ids) 時,我想獲取具有匹配 ID 的學生並緩存它們。 如果我再次使用另一組 id 調用,那么流程將像第一次一樣 go 它將檢查緩存是否存在任何 ids 數據然后從緩存中獲取它然后 go ...
[英]Spring Redis cache expiration in memory
使用 Spring Redis 緩存,想知道是否可以在 memory 中設置一些數據緩存持續時間。 緩存的緩存。 If i know that data in Redis will not change for 5 minutes i dont need that Spring Redis cac ...
[英]@CacheEvict not evicting any entries
所以我試圖在 spring 中使用 redis 實現緩存服務。這是緩存服務的代碼。 這是我正在嘗試緩存的 object。@Entity public class Permission { @Id @NotNull @GeneratedValue(strategy = Gen ...
[英]Evict cache for multiple keys rather than all in Spring Redis
有什么方法可以只為選定數量的鍵逐出緩存,而不是逐出所有條目: 我不想驅逐所有條目,而只想驅逐 Collections 中的條目。 請建議。 謝謝 ...
[英]Spring Boot Redis Cache @CachePut is not updating the cache
Cacheable 工作正常,但是當我們添加新書或更新現有的書緩存時沒有更新這是 saveOrUpdate() 的代碼,我使用 @CachePut 更新緩存但不起作用,數據庫正在更新但緩存沒有更新 我試過@EnableTransactionManagement 和@Transactional A ...
[英]Connection pooling not working in Redis Template
我對 Spring 很陌生,無法正確理解 bean 概念。 在下面的代碼中,如果我創建一個redisConnectionFactory()的 bean, redisTemplate能夠正確設置連接和連接池。 如果我不創建它的 bean,則連接池不起作用。 因為,我在redisTemplate中設置 ...
[英]Spring security getAuthentication return null?
我是新手。 我的 Spring Boot 版本是 2.7.0 這是我的安全配置 這是 CustomAuthorizationFilter 這個想法是:控制器中使用的身份驗證對象。 第一個請求被發送到服務器,服務器查詢數據庫以獲取用戶的信息並將身份驗證對象設置為安全上下文。 如果同 ...
[英]Disable Infinispan WARN logs
我在分布式模式下使用 infispan 工作正常,唯一的問題是,它打印了很多日志並弄亂了日志文件。 下面是打印的常見行。 如何禁用此日志記錄? 下面是緩存配置。 ...
[英]spring data jpa - hibernate second level cache without @QueryHints
我在我的spring boot應用程序中使用spring data jpa ,我需要啟用hibernate二級緩存來緩存一些實體。 我使用 Redis 作為我的應用程序的緩存服務器,因此我需要將Redisson與它的 Spring Boot 集成一起使用。 這是我啟用二級緩存的一些代碼示例: ...
[英]How to use Spring cache in hexagonal architecture?
在六邊形架構中,領域層不依賴於框架。 是否可以在域層中使用 Spring 緩存? ...
[英]Using Spring Cache Abstraction with entities that have one-to-many relations
我想在適當的位置添加一些緩存,但到目前為止,我看到的所有示例僅顯示了緩存簡單實體的示例(例如 Spring book 示例),這些示例在使用 @Cacheable、@CachePut 等時非常有效。 但是,鑒於這個簡單的用戶 - 角色示例: 數據庫端,3張表 一個返回用戶(及其角色)的簡單 ...
[英]Java Spring boot: How do I Store random number in cache every hour?
我正在嘗試找到一種在緩存中存儲隨機值的方法。 當用戶獲取請求時,它不會調用隨機數生成,而是使用存儲的值。 它將每小時更新一次隨機生成器。 這是執行此操作的正確方法,還是有更有效的代碼? ...
[英]Programmatic alternative to @Cacheable annotation in Spring
最近我一直在涉足架構,我有一個用例,其中經常使用相同的參數調用來自我的域的非常昂貴的計算(在你得出任何結論之前,我沒有確定參數,這些都是完全提供的由外部呼叫者)。 我想保持我的應用程序架構盡可能干凈,並且不想在我的域層中添加對 Spring 的依賴,但我仍然想使用 Spring 緩存功能。 我知道 ...
[英]Will Spring Cache cause memory leak issue?
我正在嘗試在 Spring Boot 應用程序的方法級別上使用 Spring Cache(@Cacheable 注釋),但與其他 google guava 緩存不同,我不知道 Spring Cache 是否會導致內存泄漏問題。 因為它沒有大小限制或刷新策略,所以數據將存儲在應用程序中的什么位置和多長 ...
[英]Redis Cache - Null key returned for cache operation (maybe you are using named params on classes without debug info?)
我正在為 Redis 使用 Spring 緩存。 我有 2 個方法,每個方法都返回 policyTest object,但使用不同的參數調用,如下所示。 對於這兩種方法,將 policyNo 指定為鍵,但 getPolicyByCustomerNo(String customerNo) 失敗,錯誤 ...