I have a Config class for Couchbase as follows:
@Configuration
@EnableCouchbaseRepositories
public class CouchbaseConfig extends AbstractCouchbaseConfiguration{
@Value("${couchbase.serverList:127.0.0.1}")
String IPS;
@Value("${couchbase.disabled}")
boolean disabled;
private static final Logger logger = LogManager.getLogger(CouchbaseConfig.class);
@Override
protected List<String> bootstrapHosts() {
logger.info("Array List for Couch: " + IPS);
return Arrays.asList(IPS.split(","));
}
To make it More Team Friendly i want to add a parameter disabled which allows the Application to still run if one member has not got couchbase on his local.
Is it possible?
Something like this is present in Normal couchbase configuration.
@PostConstruct
public void init() {
if (disabled)
return;
logger.info("Opening couchbase connection.");
try {
cluster = CouchbaseCluster.create(Arrays.asList(hosts.split(",")));