I have a use case in which I want updated data from the Couchbase so when I query couchbase for the data simply like:
bucket.get.query(Query.simple(query))
It gives me updated data, upto some time , but as the size of the data base increases it does not provide me updated and consistent data. Here the query is scanning an index and providing the required data accordingly. So for getting the consistent data I used the ScanConsistency.REQUESTPLUS as suggested by couchbase documentation. But as soon as I change the code and do something like this:
bucket.get.query(Query.simple(query, QueryParams.build().consistency(ScanConsistency.REQUEST_PLUS)
.serverSideTimeout(10000, TimeUnit.SECONDS)))
It gives me a timeout Exception each and everytime and never returns me the result. Can you please explain how can I achieve the consistency of the data here and why it is always giving me timeout exception.
StackTrace:
java.lang.RuntimeException: java.util.concurrent.TimeoutException
[error] at com.couchbase.client.java.util.Blocking.blockForSingle(Blocking.java:93)
[error] at com.couchbase.client.java.CouchbaseBucket.query(CouchbaseBucket.java:548)
[error] at com.couchbase.client.java.CouchbaseBucket.query(CouchbaseBucket.java:491)
Any help is appreciated.!