Java Code Examples for com.couchbase.client.CouchbaseConnectionFactoryBuilder

The following examples show how to use com.couchbase.client.CouchbaseConnectionFactoryBuilder. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: micro-server   Source File:    License: Apache License 2.0 5 votes vote down vote up
@Bean(name = "couchbaseClient")
public CouchbaseClient couchbaseClient() throws IOException, URISyntaxException {
    if (couchbaseClientEnabled) {"Creating CouchbaseClient for servers: {}", couchbaseServers);
        CouchbaseConnectionFactoryBuilder builder = new CouchbaseConnectionFactoryBuilder();
        CouchbaseConnectionFactory cf = builder.buildCouchbaseConnection(getServersList(), couchbaseBucket,
        return new CouchbaseClient(
    return null;

Example 2
Source Project: attic-apex-malhar   Source File:    License: Apache License 2.0 5 votes vote down vote up
public void connect() throws IOException
  logger.debug("connection established");
  try {
    CouchbaseConnectionFactoryBuilder cfb = new CouchbaseConnectionFactoryBuilder();
    cfb.setOpTimeout(timeout);  // wait up to 10 seconds for an operation to succeed
    cfb.setOpQueueMaxBlockTime(blockTime); // wait up to 10 second when trying to enqueue an operation
    clientMeta = new CouchbaseClient(cfb.buildCouchbaseConnection(baseURIs, bucketMeta, passwordMeta));
  } catch (IOException e) {
    logger.error("Error connecting to Couchbase: ", e);
Example 3
Source Project: GraceKelly   Source File:    License: Apache License 2.0 5 votes vote down vote up
 * Creates and returns {@link CouchbaseClient} based on the parameters provided.
 * @param urls
 * @param bucketName
 * @param password
 * @return {@link CouchbaseClient} instance.
 * @throws IOException
public static CouchbaseClient getCouchBaseClient(String[] urls, String bucketName, String password) throws IOException {

    List<URI> uris = new ArrayList<URI>();
    for (String url: urls){

    CouchbaseConnectionFactoryBuilder builder = new CouchbaseConnectionFactoryBuilder();
    CouchbaseClient couchbaseClient = new CouchbaseClient(builder.buildCouchbaseConnection(uris,bucketName,password));
    return couchbaseClient;