Hi Team,
I am trying to get the data I need from Couchbase from multiple documents using reactive api and lookupin.
It works fine till 17 arguments. It is giving me below exception after 17 variables.
Eception com.couchbase.client.core.error.DecodingFailureException: java.lang.IndexOutOfBoundsException: readerIndex(6) + length(1701999215) exceeds writerIndex(61): AbstractPooledDerivedByteBuf$PooledNonRetainedSlicedByteBuf(ridx: 6, widx: 61, cap: 61/61, unwrapped: PooledUnsafeDirectByteBuf(ridx: 88, widx: 88, cap: 16384))
Example : I have showed with 2 args
In the below specs list, I add arguments
specs.add(LookupInSpec.get(“name”));
specs.add(LookupInSpec.get(“age”));
List<LookupInSpec> specs = new ArrayList<>();
public void getMessages() {
List<JsonObject> jsonList = Flux.fromIterable(documentIds)
.flatMap(documentId -> getDocumentFieldsAsync(documentId, LookupInOptions.lookupInOptions()))
.onErrorContinue((e, o) -> {
}).map(this::mapMessage).collect(Collectors.toList()).block();
System.out.println("jsonList " + jsonList);
}
public Mono<LookupInResult> getDocumentFieldsAsync(String id, LookupInOptions options) {
Mono<LookupInResult> result = null;
result = this.cbBucket.defaultCollection().lookupIn(id, specs, options)
.doOnSuccess(p -> printMessage("Data fetched successfully")).doOnError(p -> {
String msg = "Eception ";
printMessage(msg + p);
});
return result;
}
public void printMessage(String msg) {
System.out.println(msg);
}
Is there a limitation in couchbase or a mistake from my end.
If it is mistake , kindly let me know how to modify this code?