Skip to content

Instantly share code, notes, and snippets.

@debop
Created March 25, 2013 12:01
@Configuration
@EnableCaching
@ComponentScan(basePackageClasses = {UserRepository.class})
@Slf4j
public class MongoCacheConfiguration extends AbstractMongoConfiguration {
@Override
protected String getDatabaseName() {
return "debop4j_core_cache";
}
@Override
@Bean
public Mongo mongo() throws Exception {
return new Mongo("localhost");
}
@Bean
public MongoCacheManager mongoCacheManager() throws Exception {
return new MongoCacheManager(mongoTemplate());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment