Couchbase java-client 3.0.2 bulk upsert

Hi Team I am looking for some documentation for bulk insert / upsert with java client.
I saw some examples with Flux, but I am not using spring, we are using vertx. Could you please suggest some documentation or sample code for this ?

Hi Tuhin,

If the documents you want to insert / upsert are in a list, the path of least resistance might just be to use Reactor. It’s okay if you’re not using Spring. Here’s a writeup of how to do a batch insert with a Flux. It’s framed as “how to migrate from SDK 2.x to SDK 3”, but the example code should be relevant.

If you want to do something fancier, like write documents to Couchbase as they arrive from a Vert.x stream, or do a bulk fetch and process the results with Vert.x, take a look at the Vert.x reactive streams integration. This library lets Vert.x cooperate with other libraries like Reactor that implement the Reactive Streams standard.

Thanks,
David

1 Like