How to use Atomic counters with Spring Data Couchbase Reactive

V Rao

I'm using Spring Data couchbase reactive to perform read, write, update operations. Now I have a need for something like Atomic Counters in Couchbase for one of the attributes. I read that Spring reactive doesn't support this ( may it is now) feature yet, so would like guidance about how to go about this.

I have already looked at the solution provided in other ticket: Atomic counters in Spring with Couchbase But this is not blocking calls, so I was wondering if I can have something similar for making non blocking calls as well.

I can use Couchbase's reactive client for this but then it means I need to combine Reactive client of Couchbase and Spring Data Couchbase reactive for which I am not too confident if it is good approach or not.

deniswsrosa

Atomic counters are not part of the Spring Data specification (Spring Data was originally designed for RDBMS)

A few options are:

1) Make a simple sync call via the bucket object:

myRepository.getCouchbaseOperations().getCouchbaseBucket().counter("mycounter", 1L, 1L );

2) Use the standard Couchbase Java Reactive SDK (RxJava) and convert the Observable: Adapting RxJava 1.1.5 to Reactor Core 3.1.0.M3

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Does Spring Data Couchbase reactive support pagination?

How to use kotlin coroutines with reactive spring data

How do I use transactions in Spring Data Redis Reactive?

How to use db references with reactive Spring Data MongoDB?

Spring Data for Couchbase: use of AND ANY ... SATISFIES

How to connect to couchbase databse using spring data couchbase and yaml properties?

How to set couchbase operation timeout in spring data couchbase?

Couchbase BulkGet in spring data couchbase

How Couchbase Lite use SQlite for NoSQL data

How to use iterable in StepVerifier in Spring Reactive testing

How apply pagination in reactive Spring Data?

Spring 5 Web Reactive - How can we use WebClient to retrieve streamed data in a Flux?

How to use multiple counters in Flink

cuda group by and atomic counters

How to use Spring JPA for Couchbase nested document values

How to tell Spring Data Couchbase to embed or reference entity?

Spring Data Couchbase: How to rename fields from nested POJOs?

How to log Spring-data queries to a Couchbase Database

How can I make Spring Data Couchbase persist the id field?

How to write Couchbase N1QL query in spring data?

How to generate unique id with prefix using Spring Data Couchbase SDK?

Spring Data Project - Couchbase Integration

Spring Data Couchbase problems with indexes

_class field and spring data couchbase

Spring Data Couchbase @CreatedDate not working

How to use Mono and Flux in handler functions with Spring WebFlux Reactive ways

How to use Spring Reactive WebSocket and transform it into the Flux stream?

How do I use a Transaction in a Reactive Flow in Spring Integration?

How is spring reactive asynchronous?