Java client 1.1-dp - Returns null values when using CouchbaseConnectionFactoryBuilder
Hi,
Java client 1.1-dp seems to have a problem using CouchbaseConnectionFactoryBuilder. Client.get() returns null values regardless of whether a key exists or not. Java client 1.0.3 doesn't have the problem.
With 1.1-dp, if I set up a client like so:
URI base = new URI(String.format("http://%s:8091/pools", server));
List baseURIs = new ArrayList();
baseURIs.add(base);
CouchbaseConnectionFactoryBuilder cfb = new CouchbaseConnectionFactoryBuilder();
cfb.setOpTimeout(10000);
cfb.setOpQueueMaxBlockTime(10000);
CouchbaseConnectionFactory cf = cfb.buildCouchbaseConnection(baseURIs, bucket, "", "");
CouchbaseClient client = new CouchbaseClient(cf);
then try to get a key like so:
getFuture = client.asyncGet(key);
value = (String) getFuture.get(); // value is null
the .get() doesn't fail but the returned value is null.
However, if I set up the 1.1-dp client like so, using just CouchbaseConnectionFactory:
URI base = new URI(String.format("http://%s:8091/pools", server));
List baseURIs = new ArrayList();
baseURIs.add(base);
CouchbaseConnectionFactory cf = new CouchbaseConnectionFactory(baseURIs, bucket, "");
CouchbaseClient client = new CouchbaseClient(cf);
getFuture = client.asyncGet(key);
value = (String) getFuture.get(); // value is not null and contains the document for the key
I want to use CouchbaseConnectionFactoryBuilder because I'm doing a bulk import of millions of documents and I need the timeout/blocking behaviour to prevent swamping the client.
Java client 1.0.3 works correctly - using CouchbaseConnectionFactoryBuilder to build connection factories and clients results in the correct behaviour.
Is there something I'm doing wrong - or is this a bug? If it is a bug I'll lodge an issue in Jira.
Cheers,
Tim
Hi Tim,
There was a bug with setting the auth correctly when using the ConnectionFactoryBuilder, but that's been fixed. It's not yet in a release. In the next day or so we should have 1.1DP2 posted, which will have the fix.
Sorry for the hassle,
Matt