Skip to content

Instantly share code, notes, and snippets.

@sumanentc
Created October 25, 2021 09:25
Show Gist options
  • Save sumanentc/8dc314de98d970ebf0adc70ebac63988 to your computer and use it in GitHub Desktop.
Save sumanentc/8dc314de98d970ebf0adc70ebac63988 to your computer and use it in GitHub Desktop.
@Configuration
public class IgniteCacheManagerConfiguration {
private final String igniteConfigPath;
public IgniteCacheManagerConfiguration(@Value(IGNITE_CONFIG_PROP_SPRING) String igniteConfigPath) {
this.igniteConfigPath = igniteConfigPath;
}
@DependsOn(IGNITE_SYSTEM_PROPERTIES_CONFIGURATION)
@Bean
public CacheManager cacheManager(ResourceLoader resourceLoader) throws IOException {
return Caching.getCachingProvider().getCacheManager(resourceLoader
.getResource(igniteConfigPath).getURI(), getClass().getClassLoader());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment