cosmos pagination is not working with latest springboot libraries

ja 26 Reputation points
We have a springboot project which is using cosmos libraries and the pageable feature of it. It was working as expected. Now, after upgrading the springboot to 3.X.X version, the pagination feature is not working.

We always get the last 3 data even though we pass diff page.

    public interface BaseRepository extends CosmosRepository<Base, String>, CrudRepository<Base, String> {
        @Query("select * from c where c.base=@baseId)")
        Page<Base> findByBaseId(
            @Param("baseId") String baseId,
            Pageable pageable);

This the code that we are using, it was giving expected result based on the page number passed in the Paegable object. but now, it always return the latest X number data.

This is how we are initialising the Pageable :

    PageRequest of(int page, int size, Sort sort)

I dont see any reasons why it shopped working? Any pointers?  

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,439 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 16,076 Reputation points Microsoft Employee

    @ja Thank you for reaching out.

    As mentioned by Matias Quaranta from the Azure Cosmos DB PG team.

    Currently Spring Data Cosmos does not support Spring Boot 3 or Spring Data 3 ->

    That is potentially the reason it is not working as expected when you migrated from 2.7.6 to 3.X (major version bump).



    0 comments No comments