1. public class CouchbaseCacheConfiguration {
    2. private final Cluster cluster;
    3. public CouchbaseCacheConfiguration(Cluster cluster) {
    4. this.cluster = cluster;
    5. @Bean
    6. public Bucket anotherBucket() {
    7. return this.cluster.openBucket("another", "secret");
    8. @Bean
    9. return c -> {
    10. c.prepareCache("biz", CacheBuilder.newInstance(anotherBucket())
    11. .withExpirationInMillis(2000));
    12. };
    13. }
    14. }