Observable.interval , AsyncMutateInBuilder not supported in Couchbase SDK3

I am trying to migrate from Couchbase 2 to Couchbase 3.
But there are lot of compilation errors in below code

                    // Loop size
                    // Update by each item
                    .flatMap(index -> {
                        String documentId = ids.get(index.intValue());
                        AsyncMutateInBuilder builder = bucket.async().mutateIn(documentId);
                        builder.upsert("status", status);
                        builder.upsert("updated_datetime",     updatedDatetime);
                        return builder.execute().onErrorReturn(ex -> {
                            // skip DocumentDoesNotExistException
                            if (ex instanceof DocumentDoesNotExistException) {
                                LOG.warn("Doesn't get item [ docId = {} ]", docId);
                                return null;
                            throw new PlatformCouchbaseRetryException(ex);
                    // handling error
                    .onErrorReturn(ex -> {
                        throw new PlatformCouchbaseRetryException(ex);
                    // synchronized

config,getUpdatedDatetimeInterval() is long

  1. Observable is not supported in SDK 3 and if i try to use Flux then i am not sure of the Duration and Scheduler that i need to provide in
    Flux.interval(Duration, Scheduler)

  2. AsyncMutateInBuilder is not supported in SDK3

How can i modify the existing code to be in SDK3 ?

@rishabh_katyal I see you are posting a lot of migration questions here - while we are happy to help out where we can, I think it is also in your interest to make yourself familiar with two topics:

  1. project reactor, since you are using reactive APIs extensively. See Reactor 3 Reference Guide as a guide to get you started there, which will cover topics like schedulers as well.
  2. the migration guide Migrating from SDK2 to SDK3 API | Couchbase Docs
  3. and in this specific case subdoc operations in SDK 3 Sub-Document Operations with the Java SDK | Couchbase Docs

If after working through those topics to get you started there are still questions please don’t hesitate to ask them here, but I’m confident those cover points 1. and 2. that you asked.

@daschl Thanks… I have checked most of the documents. But let me go through them again to get more idea about this.

For the AsyncMutateInBuilder part, you can just use the example from Mutiple Upsert in Couchbase SDK 3 - #4 by graham.pople but use collection.reactive(). E.g.

   collection.reactive().mutateIn(documentId, Arrays.asList(
                MutateInSpec.upsert("status", status),
                MutateInSpec.upsert("updated_datetime", updatedDatetime)));

Thanks @graham.pople