Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caffeine cache with cache manager - caffeine/no-op #23

Open
wants to merge 1 commit into
base: release-4.6.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.kie.internal.io.ResourceFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down Expand Up @@ -50,7 +51,7 @@ public class AppConfigOrchestrator {
public String FUSIONAUTH_KEY;

@Autowired
public Cache<Object, Object> cache;
public CacheManager cacheManager;

@Bean
public FusionAuthClient getFAClient() {
Expand All @@ -64,7 +65,7 @@ public CampaignService getCampaignService() {
.defaultHeader("admin-token", CAMPAIGN_ADMIN_TOKEN)
.build();
FusionAuthClient fusionAuthClient = getFAClient();
return new CampaignService(webClient, fusionAuthClient, cache);
return new CampaignService(webClient, fusionAuthClient, cacheManager);
}

@Bean
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ spring.r2dbc.password=${FORMS_DB_PASSWORD}
caffeine.cache.max.size=0
caffeine.cache.exprie.duration.seconds=${CAFFEINE_CACHE_EXPIRE_DURATION:#{300}}

#Active profile - development environment
#Possible values - dev, staging, production
#To disable cache - set it as dev
spring.profiles.active=${DEVELOPMENT_ENV:#{production}}