-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cee1dc
commit caa7b1a
Showing
4 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/java/com/app/sellerretailreports/cache/SpringCacheCustomizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.app.sellerretailreports.cache; | ||
|
||
import java.util.List; | ||
import org.springframework.boot.autoconfigure.cache.CacheManagerCustomizer; | ||
import org.springframework.cache.concurrent.ConcurrentMapCacheManager; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class SpringCacheCustomizer implements CacheManagerCustomizer<ConcurrentMapCacheManager> { | ||
@Override | ||
public void customize(ConcurrentMapCacheManager cacheManager) { | ||
cacheManager.setCacheNames(List.of( | ||
"salesAndTrafficByDatesBetween", | ||
"salesAndTrafficBySpecifiedDate", | ||
"salesAndTrafficBySpecifiedAsins", | ||
"salesAndTrafficByAsins", | ||
"salesAndTrafficByDates" | ||
) | ||
); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/app/sellerretailreports/cache/SpringCachingConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.app.sellerretailreports.cache; | ||
|
||
import org.springframework.cache.CacheManager; | ||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.cache.concurrent.ConcurrentMapCacheManager; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@EnableCaching | ||
public class SpringCachingConfig { | ||
@Bean | ||
public CacheManager cacheManager() { | ||
return new ConcurrentMapCacheManager(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters