1

I'm using Spring Webflux & reactor, Java 11, Spring boot 2.4.5, Spring 5.3.6, spring-boot-starter-data-couchbase-reactive 2.4.5 versions for this reactive application.
Use case:
Website wants data in pagination format (to display total number of pages with the ability for the user to select any page).
But spring-data-reactive doesn't return response with Pageable object.
is there a way to make spring-data-reactive return pageable object in response?
my current code:

Flux<Entity> findByEventId(Integer eventId, Pageable pageable);

One way to overcome this is by calling count method and get the record count.

Mono<Long> countByEventId(Integer eventId);

Is there a better solution to this at API layer? (also any suggestion to cater use case at UI side)

Chethan
  • 33
  • 5

0 Answers0