We are using Java SDK 2.3.3 and we found that the upsert is failing without any exceptions. We are using couchbase server 4.1 and storing LegacyDocuments. Below is the code snippet for storing documnets.
/* Upsert Code*/
LegacyDocument document = LegacyDocument.create(key, ttl, value);
couchManager.getDataBucket(requestType).async().upsert(document); //This gives an AsyncBucket and does an upsert operation.
If you perform an async operation you need to subscribe to it, otherwise it will not be executed.
For blocking, try .upsert(document).toBlocking().single(); or if you want to still be async use .subscribe() and variants, but keep in mind that this won’t be executed on the current thread so don’t use .subscribe() and then let the main thread exit.
The documentation has lots of stuff on this topic!
The reason why it did work on 2.1 is that the observables were “hot” back then, but your code was still wrong from a contract perspective - you always need to subscribe to an observable to execute it.
Yeah it was hot observable that’s why we dint do any blocking subscription. I have one more doubt this subscription will execute on which threadpool? cb-io or cb-core?