diff --git a/data/data-samples/pom.xml b/data/data-samples/pom.xml
index e0f6b13eb..585f8d1ee 100644
--- a/data/data-samples/pom.xml
+++ b/data/data-samples/pom.xml
@@ -35,6 +35,7 @@
sample-data-mysql-book
sample-data-mysql-reactive-book
sample-data-redis-book
+ sample-data-couchbase-reactive
diff --git a/data/data-samples/sample-data-couchbase-reactive/pom.xml b/data/data-samples/sample-data-couchbase-reactive/pom.xml
new file mode 100644
index 000000000..f318d9422
--- /dev/null
+++ b/data/data-samples/sample-data-couchbase-reactive/pom.xml
@@ -0,0 +1,43 @@
+
+
+
+ 4.0.0
+
+ io.americanexpress.synapse
+ data-samples
+ 0.3.8-SNAPSHOT
+
+
+ sample-data-couchbase-reactive
+
+
+
+ io.americanexpress.synapse
+ synapse-data-couchbase
+
+
+ io.projectreactor
+ reactor-test
+ test
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+
+
+
+
diff --git a/data/data-samples/sample-data-couchbase-reactive/src/main/java/io/americanexpress/data/book/config/BookDataConfig.java b/data/data-samples/sample-data-couchbase-reactive/src/main/java/io/americanexpress/data/book/config/BookDataConfig.java
new file mode 100644
index 000000000..3a54edfab
--- /dev/null
+++ b/data/data-samples/sample-data-couchbase-reactive/src/main/java/io/americanexpress/data/book/config/BookDataConfig.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.data.book.config;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import io.americanexpress.synapse.data.couchbase.config.BaseReactiveCouchbaseDataConfig;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.core.env.Environment;
+import org.springframework.data.couchbase.repository.config.EnableReactiveCouchbaseRepositories;
+
+import static io.americanexpress.data.book.config.BookDataConfig.PACKAGE_NAME;
+
+@Configuration
+@PropertySource("classpath:/data-book-application.properties")
+@EnableReactiveCouchbaseRepositories(basePackages = PACKAGE_NAME)
+public class BookDataConfig extends BaseReactiveCouchbaseDataConfig {
+
+ /**
+ * The Package name.
+ */
+ static final String PACKAGE_NAME = "io.americanexpress.data.book";
+
+ protected BookDataConfig(Environment environment, ObjectMapper objectMapper) {
+ super(environment, objectMapper);
+ }
+}
diff --git a/data/data-samples/sample-data-couchbase-reactive/src/main/java/io/americanexpress/data/book/entity/BookEntity.java b/data/data-samples/sample-data-couchbase-reactive/src/main/java/io/americanexpress/data/book/entity/BookEntity.java
new file mode 100644
index 000000000..b864e4435
--- /dev/null
+++ b/data/data-samples/sample-data-couchbase-reactive/src/main/java/io/americanexpress/data/book/entity/BookEntity.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.data.book.entity;
+
+import org.springframework.data.annotation.Id;
+import org.springframework.data.couchbase.core.mapping.Document;
+import org.springframework.data.couchbase.core.mapping.Field;
+import org.springframework.data.couchbase.core.mapping.id.GeneratedValue;
+
+import static org.springframework.data.couchbase.core.mapping.id.GenerationStrategy.UNIQUE;
+
+/**
+ * The type Book entity.
+ */
+@Document
+public class BookEntity {
+
+ @Id
+ @GeneratedValue(strategy = UNIQUE)
+ private String id;
+
+ @Field
+ private String title;
+
+ @Field
+ private String author;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getAuthor() {
+ return author;
+ }
+
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+}
diff --git a/data/data-samples/sample-data-couchbase-reactive/src/main/java/io/americanexpress/data/book/repository/BookRepository.java b/data/data-samples/sample-data-couchbase-reactive/src/main/java/io/americanexpress/data/book/repository/BookRepository.java
new file mode 100644
index 000000000..743706c42
--- /dev/null
+++ b/data/data-samples/sample-data-couchbase-reactive/src/main/java/io/americanexpress/data/book/repository/BookRepository.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.data.book.repository;
+
+import io.americanexpress.data.book.entity.BookEntity;
+import org.springframework.data.repository.reactive.ReactiveCrudRepository;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface BookRepository extends ReactiveCrudRepository {
+}
diff --git a/data/data-samples/sample-data-couchbase-reactive/src/main/resources/application.properties b/data/data-samples/sample-data-couchbase-reactive/src/main/resources/application.properties
new file mode 100644
index 000000000..365dabef4
--- /dev/null
+++ b/data/data-samples/sample-data-couchbase-reactive/src/main/resources/application.properties
@@ -0,0 +1,14 @@
+#/*
+#* Copyright 2020 American Express Travel Related Services Company, Inc.
+#*
+#* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+#* in compliance with the License. You may obtain a copy of the License at
+#*
+#* http://www.apache.org/licenses/LICENSE-2.0
+#*
+#* Unless required by applicable law or agreed to in writing, software distributed under the License
+#* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+#* or implied. See the License for the specific language governing permissions and limitations under
+#* the License.
+#*/
+spring.main.allow-bean-definition-overriding=true
diff --git a/data/data-samples/sample-data-couchbase-reactive/src/main/resources/data-book-application.properties b/data/data-samples/sample-data-couchbase-reactive/src/main/resources/data-book-application.properties
new file mode 100644
index 000000000..19b8c1f9e
--- /dev/null
+++ b/data/data-samples/sample-data-couchbase-reactive/src/main/resources/data-book-application.properties
@@ -0,0 +1,17 @@
+#/*
+#* Copyright 2020 American Express Travel Related Services Company, Inc.
+#*
+#* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+#* in compliance with the License. You may obtain a copy of the License at
+#*
+#* http://www.apache.org/licenses/LICENSE-2.0
+#*
+#* Unless required by applicable law or agreed to in writing, software distributed under the License
+#* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+#* or implied. See the License for the specific language governing permissions and limitations under
+#* the License.
+#*/
+spring.couchbase.connection-string=127.0.0.1
+spring.couchbase.bucket-name=synapse
+spring.couchbase.username=admin
+spring.couchbase.password=password
diff --git a/data/synapse-data-couchbase/README.md b/data/synapse-data-couchbase/README.md
index a87fb312a..dbe4ea180 100644
--- a/data/synapse-data-couchbase/README.md
+++ b/data/synapse-data-couchbase/README.md
@@ -10,7 +10,7 @@
- An open to extension base configuration java file with the standard connection parameters needed to connect to
couchbase using Spring Data. The connection parameters will be provided by the property files on the module(s)that
you as a developer are creating that will use this base-data-postgres module as a dependency.
- - An open to extension BaseEntity containing the generated key identifier and the common auditing fields maintained
+ - An open to extension `BaseEntity` containing the generated key identifier and the common auditing fields maintained
by the Spring Data framework itself (createdBy, lastModifiedBy, createdDate, lastModifiedDate and version).
## Usage
@@ -26,3 +26,10 @@ Or add the following to the build.gradle file:
```
implementation 'io.americanexpress.synapse:synapse-data-couchbase:0.2.1!!'
```
+- Create a configuration class extending `BaseReactiveCouchbaseDataConfig` for reactive support or `BaseCrudCouchbaseDataConfig` for non-reactive usage.
+- Create repository interfaces extending `ReactiveCrudRepository` for reactive support or `BaseCrudCouchbaseRepository` for non-reactive.
+
+## Examples
+Examples of utilizing the synapse-data-couchbase module can be found in the following modules:
+- sample-data-couchbase-reactive
+- sample-service-reactive-couchbase-book
diff --git a/pom.xml b/pom.xml
index b75264b18..8b4336093 100644
--- a/pom.xml
+++ b/pom.xml
@@ -389,6 +389,11 @@
sample-data-cassandra-reactive
${project.version}
+
+ io.americanexpress.synapse
+ sample-data-couchbase-reactive
+ ${project.version}
+
io.americanexpress.synapse
sample-data-mongodb-book
@@ -597,13 +602,6 @@
-
- org.springframework.cloud
- spring-cloud-dependencies
- 2022.0.0-RC3
- pom
- import
-
org.springframework.cloud
spring-cloud-starter-function-web
diff --git a/service/service-samples/pom.xml b/service/service-samples/pom.xml
index 5a50e8525..9b811de93 100644
--- a/service/service-samples/pom.xml
+++ b/service/service-samples/pom.xml
@@ -25,6 +25,7 @@
sample-service-rest-mysql-book
sample-service-rest-oracle-book
sample-service-rest-postgres-book
+ sample-service-reactive-couchbase-book
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/pom.xml b/service/service-samples/sample-service-reactive-couchbase-book/pom.xml
new file mode 100644
index 000000000..faec3ffb8
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/pom.xml
@@ -0,0 +1,40 @@
+
+
+
+ 4.0.0
+
+ io.americanexpress.synapse
+ service-samples
+ 0.3.8-SNAPSHOT
+
+
+ sample-service-reactive-couchbase-book
+
+
+
+
+
+ io.americanexpress.synapse
+ synapse-service-rest
+
+
+ io.americanexpress.synapse
+ sample-data-couchbase-reactive
+
+
+
+
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/BookApplication.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/BookApplication.java
new file mode 100644
index 000000000..91c6630b5
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/BookApplication.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest;
+
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.info.Info;
+import org.slf4j.ext.XLogger;
+import org.slf4j.ext.XLoggerFactory;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * BookApplication starts the Spring Boot Application for the book rest sample.
+ */
+@OpenAPIDefinition(info = @Info(
+ title = "Book API",
+ version = "v1.0.0",
+ description = "Rest API that provides book related information."))
+@SpringBootApplication
+public class BookApplication {
+
+ private static final XLogger LOGGER = XLoggerFactory.getXLogger(BookApplication.class);
+
+ /**
+ * Main method to run the Spring Boot Book Application.
+ *
+ * @param args the args
+ */
+ public static void main(String[] args) {
+ SpringApplication.run(BookApplication.class, args);
+ LOGGER.info("Rest Book Application is up and running ...");
+ }
+
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/config/BookConfig.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/config/BookConfig.java
new file mode 100644
index 000000000..e5f323220
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/config/BookConfig.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.config;
+
+import io.americanexpress.data.book.config.BookDataConfig;
+import io.americanexpress.synapse.service.rest.config.ServiceRestConfig;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.PropertySource;
+
+/**
+ * {@code BookConfig} is the configuration class for the Book Application.
+ */
+@Configuration
+@PropertySource("classpath:/service-book-application.properties")
+@ComponentScan(basePackages = "io.americanexpress.service.book.rest")
+@Import({ServiceRestConfig.class, BookDataConfig.class})
+public class BookConfig {
+
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/config/BookEndpoints.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/config/BookEndpoints.java
new file mode 100644
index 000000000..cc45d78e5
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/config/BookEndpoints.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.config;
+
+/**
+ * {@code BookEndpoints} contains the endpoint for the Book API.
+ */
+public class BookEndpoints {
+
+ /**
+ * The constant BOOK_ENDPOINT.
+ */
+ public static final String BOOK_ENDPOINT = "/v1/books";
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/controller/CreateBookReactiveController.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/controller/CreateBookReactiveController.java
new file mode 100644
index 000000000..de399e866
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/controller/CreateBookReactiveController.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.controller;
+
+import io.americanexpress.service.book.rest.config.BookEndpoints;
+import io.americanexpress.service.book.rest.model.CreateBookRequest;
+import io.americanexpress.service.book.rest.model.CreateBookResponse;
+import io.americanexpress.service.book.rest.service.CreateBookReactiveService;
+import io.americanexpress.synapse.service.rest.controller.reactive.BaseCreateReactiveController;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * {@code CreateBookReactiveController} creates a book given a CreateBookRequest.
+ */
+@RestController
+@RequestMapping(BookEndpoints.BOOK_ENDPOINT)
+public class CreateBookReactiveController extends BaseCreateReactiveController {
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/controller/ReadPolyBookReactiveController.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/controller/ReadPolyBookReactiveController.java
new file mode 100644
index 000000000..a89bc0584
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/controller/ReadPolyBookReactiveController.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.controller;
+
+import io.americanexpress.service.book.rest.config.BookEndpoints;
+import io.americanexpress.service.book.rest.model.ReadBookRequest;
+import io.americanexpress.service.book.rest.model.ReadBookResponse;
+import io.americanexpress.service.book.rest.service.ReadPolyBookReactiveService;
+import io.americanexpress.synapse.service.rest.controller.reactive.BaseReadPolyReactiveController;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * {@code ReadPolyBookReactiveController} retrieves books given a ReadBookRequest.
+ */
+@RestController
+@RequestMapping(BookEndpoints.BOOK_ENDPOINT)
+public class ReadPolyBookReactiveController extends BaseReadPolyReactiveController {
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/CreateBookRequest.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/CreateBookRequest.java
new file mode 100644
index 000000000..6bc714a92
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/CreateBookRequest.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.model;
+
+import io.americanexpress.synapse.service.rest.model.BaseServiceRequest;
+import jakarta.validation.constraints.NotBlank;
+
+/**
+ * {@code CreateBookRequest} is the request for the create book operation.
+ */
+public class CreateBookRequest implements BaseServiceRequest {
+
+ /**
+ * Title of book.
+ */
+ @NotBlank
+ private String title;
+
+ /**
+ * Author of book.
+ */
+ @NotBlank
+ private String author;
+
+ /**
+ * Gets title.
+ *
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Sets title.
+ *
+ * @param title the title
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * Gets author.
+ *
+ * @return the author
+ */
+ public String getAuthor() {
+ return author;
+ }
+
+ /**
+ * Sets author.
+ *
+ * @param author the author
+ */
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/CreateBookResponse.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/CreateBookResponse.java
new file mode 100644
index 000000000..c14fefbbf
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/CreateBookResponse.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.model;
+
+import io.americanexpress.synapse.service.rest.model.BaseServiceResponse;
+
+/**
+ * {@code CreateBookResponse} is the response for the create book operation.
+ */
+public class CreateBookResponse extends BaseServiceResponse {
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/ReadBookRequest.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/ReadBookRequest.java
new file mode 100644
index 000000000..5e8dfd973
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/ReadBookRequest.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.model;
+
+import io.americanexpress.synapse.service.rest.model.BaseServiceRequest;
+
+/**
+ * {@code ReadBookRequest} is the request for the read book operation.
+ */
+public class ReadBookRequest implements BaseServiceRequest {
+
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/ReadBookResponse.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/ReadBookResponse.java
new file mode 100644
index 000000000..3d1415928
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/model/ReadBookResponse.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.model;
+
+import io.americanexpress.synapse.service.rest.model.BaseServiceResponse;
+
+/**
+ * {@code ReadBookResponse} is the response for the read book operation.
+ */
+public class ReadBookResponse extends BaseServiceResponse {
+
+ /**
+ * Title of book.
+ */
+ private String title;
+
+ /**
+ * Author of book.
+ */
+ private String author;
+
+ /**
+ * Number of copies of book.
+ */
+ private int numberOfCopies;
+
+ /**
+ * Gets title.
+ *
+ * @return the title
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Sets title.
+ *
+ * @param title the title
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * Gets author.
+ *
+ * @return the author
+ */
+ public String getAuthor() {
+ return author;
+ }
+
+ /**
+ * Sets author.
+ *
+ * @param author the author
+ */
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+
+ /**
+ * Gets number of copies.
+ *
+ * @return the number of copies
+ */
+ public int getNumberOfCopies() {
+ return numberOfCopies;
+ }
+
+ /**
+ * Sets number of copies.
+ *
+ * @param numberOfCopies the number of copies
+ */
+ public void setNumberOfCopies(int numberOfCopies) {
+ this.numberOfCopies = numberOfCopies;
+ }
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/service/CreateBookReactiveService.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/service/CreateBookReactiveService.java
new file mode 100644
index 000000000..08cf85cb9
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/service/CreateBookReactiveService.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.service;
+
+
+import io.americanexpress.data.book.entity.BookEntity;
+import io.americanexpress.data.book.repository.BookRepository;
+import io.americanexpress.service.book.rest.model.CreateBookRequest;
+import io.americanexpress.service.book.rest.model.CreateBookResponse;
+import io.americanexpress.synapse.service.rest.service.reactive.BaseCreateReactiveService;
+import org.springframework.http.HttpHeaders;
+import org.springframework.stereotype.Service;
+import reactor.core.publisher.Mono;
+
+/**
+ * {@code CreateBookReactiveService} creates book in the database given request.
+ */
+@Service
+public class CreateBookReactiveService extends BaseCreateReactiveService {
+
+ /**
+ * Used to save new book into database.
+ */
+ private final BookRepository bookRepository;
+
+ /**
+ * Instantiates a new CreateBookReactiveService.
+ *
+ * @param bookRepository the book repository
+ */
+ public CreateBookReactiveService(BookRepository bookRepository) {
+ this.bookRepository = bookRepository;
+ }
+
+ /**
+ * Creates new book in database.
+ *
+ * @param request the updateBookRequest
+ */
+ @Override
+ protected Mono executeCreate(HttpHeaders headers, CreateBookRequest request) {
+ BookEntity bookEntity = new BookEntity();
+ bookEntity.setTitle(request.getTitle());
+ bookEntity.setAuthor(request.getAuthor());
+
+ return bookRepository.save(bookEntity).map(book -> new CreateBookResponse()).switchIfEmpty(Mono.empty());
+
+ }
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/service/ReadPolyBookReactiveService.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/service/ReadPolyBookReactiveService.java
new file mode 100644
index 000000000..d6b2a1ed3
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/service/ReadPolyBookReactiveService.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.service;
+
+import io.americanexpress.data.book.repository.BookRepository;
+import io.americanexpress.service.book.rest.model.ReadBookRequest;
+import io.americanexpress.service.book.rest.model.ReadBookResponse;
+import io.americanexpress.service.book.rest.service.helper.ReadBookResponseCreator;
+import io.americanexpress.synapse.service.rest.service.reactive.BaseReadPolyReactiveService;
+import org.springframework.http.HttpHeaders;
+import org.springframework.stereotype.Service;
+import reactor.core.publisher.Flux;
+
+
+/**
+ * {@code ReadPolyBookReactiveService} retrieves books from the database given request.
+ */
+@Service
+public class ReadPolyBookReactiveService extends BaseReadPolyReactiveService {
+
+ /**
+ * Used to retrieve books from database.
+ */
+ private final BookRepository bookRepository;
+
+ /**
+ * Instantiates a new ReadPolyBookReactiveService.
+ *
+ * @param bookRepository the book repository
+ */
+ public ReadPolyBookReactiveService(BookRepository bookRepository) {
+ this.bookRepository = bookRepository;
+ }
+
+ /**
+ * Retrieves the list of books from database as requested in request.
+ *
+ * @param request the readBookRequest
+ */
+ @Override
+ protected Flux executeRead(HttpHeaders headers, ReadBookRequest request) {
+ return bookRepository.findAll()
+ .map(ReadBookResponseCreator::create)
+ .switchIfEmpty(Flux.empty());
+ }
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/service/helper/ReadBookResponseCreator.java b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/service/helper/ReadBookResponseCreator.java
new file mode 100644
index 000000000..0b3d86eb7
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/java/io/americanexpress/service/book/rest/service/helper/ReadBookResponseCreator.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2020 American Express Travel Related Services Company, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package io.americanexpress.service.book.rest.service.helper;
+
+import io.americanexpress.data.book.entity.BookEntity;
+import io.americanexpress.service.book.rest.model.ReadBookResponse;
+
+/**
+ * {@code ReadBookResponseCreator} is the helper class for creating a ReadBookResponse from BookEntity.
+ */
+public class ReadBookResponseCreator {
+
+ /**
+ * Create read book response.
+ *
+ * @param book the book entity
+ * @return the read book response
+ */
+ public static ReadBookResponse create(BookEntity book) {
+ ReadBookResponse response = null;
+ if(book != null) {
+ response = new ReadBookResponse();
+ response.setTitle(book.getTitle());
+ response.setAuthor(book.getAuthor());
+ }
+ return response;
+ }
+}
diff --git a/service/service-samples/sample-service-reactive-couchbase-book/src/main/resources/service-book-application.properties b/service/service-samples/sample-service-reactive-couchbase-book/src/main/resources/service-book-application.properties
new file mode 100644
index 000000000..ed8abeb0c
--- /dev/null
+++ b/service/service-samples/sample-service-reactive-couchbase-book/src/main/resources/service-book-application.properties
@@ -0,0 +1,18 @@
+#/*
+#* Copyright 2020 American Express Travel Related Services Company, Inc.
+#*
+#* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+#* in compliance with the License. You may obtain a copy of the License at
+#*
+#* http://www.apache.org/licenses/LICENSE-2.0
+#*
+#* Unless required by applicable law or agreed to in writing, software distributed under the License
+#* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+#* or implied. See the License for the specific language governing permissions and limitations under
+#* the License.
+#*/
+spring.application.name=Book Rest Service
+spring.main.allow-bean-definition-overriding=true
+server.port=8080
+wavefront.application.name=bookstore
+wavefront.application.service=example-service-rest-book