Hi All,
I am using SpringWebflux with SpringDataCouchbase 4.1.3,SpringBtoot2.4.2 for a reactive api end point based on FTS.
Inside my service method I use reactive FTS api like below.
Mono result= cluster.reactive().searchQuery(indexName, disjunctionQuery);
return result.flatMapMany(sr->sr.rows()).map(row->{
Project p=new Project();
p.set_id(row.id());
p.setName(bucket.reactive().defaultCollection().get(row.id()).block().contentAsObject().get(“name”).toString());
etc
You can see I am using a blocking call to set the dto where api end point is exposed as Flux .
Is there a better way to populate the dtos without invoking block() call inside reactive FTS service call?
Thanks,
Isuru