Java 8.x Cassandra 3.11.x Rest client Spring boot maven 3.x
dependency: swagger,springboot 1.5.x
CREATE KEYSPACE IF NOT EXISTS target WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : N };
create table if not exists target.product_pricing (id int PRIMARY KEY, currency text, price double );
Application PORT and cassandra details should be provided in application.properties and cassandra.properties respectively
mvn clean install -DskipTests=true
java -jar <jarpath/jarname>
eg. java -jar /home/rvretailservice-0.0.1-SNAPSHOT.jar
http://localhost:9080/swagger-ui.html#/retail-rest-controller
swagger url to know more details: http://localhost:9080/swagger-ui.html#/retail-rest-controller
- GET single Product by its Id
- Create a product with price details
- Update the price.
Product name is provided by external rest based interface
- URL for POST request : http://localhost:9080/product/
POST Json body format:
{ "id":"", "name":"RASHMI", "priceDetails":{ "price":"11", "currency":"USD" } }
-
Get request URL: http://localhost:9080/product/
-
Put will have similar format as POST.
Basic validation are provided for the CRUD operations mentioned above