• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown

SpringBoot Reactive with Couchbase

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am a bit new with Spring Boot.
I have setup a Couchbase database and created a couple of buckets one which is called Resources

I can have setup a couple of endpoints and can connect to the database through a repository

The repository is as shown: Also I have attached the java files

I can retrieve an individual resource with it's resource id and everything works fine. However, I cannot get the findAll to work.
In addition, I cannot post a resource and have it saved.

Any ideas ?

I have zipped the src folder
Also the resource bucket has been configured with a PRIMARY index and another index on resourceId

I am confused why I get no error just an empty list when I do a findAll
Is there anything I need to configure in couchbase ?

Here is my code snippets

class UserRestService {

private static final int String = 0;
UserRepository userRepository;

public UserRestService(UserRepository userRepository) {
this.userRepository = userRepository;

@GetMapping( value="/users")
// ResponseEntity< List<User>>
Flux<User> allUsers() {

return this.userRepository.findAll();

@GetMapping( value="/users/{resourceId}")
          Mono< User> aUser(@PathVariable(value  = "resourceId", required = false ) String resourceId ) {
return this.userRepository.findById(resourceId );

@PostMapping( value="/users/{resourceId}")
ResponseEntity< String > postUser( @RequestBody User theUser) {

return ResponseEntity.status(HttpStatus.CREATED).build();


class User {
String id;

String role;

public String toString() {
return "User [id=" + id + ", role=" + role + ", organizationId=" + organizationId + "]";

String organizationId;

public String getId() {
return id;

public void setId(String id) {
this.id = id;

public String getRole() {
return role;

public void setRole(String role) {
this.role = role;

public String getOrganizationId() {
return organizationId;

public void setOrganizationId(String organizationId) {
this.organizationId = organizationId;

public interface UserRepository
extends ReactiveCrudRepository<User, String> {
Flux< User > findAll();


    Bookmark Topic Watch Topic
  • New Topic