MicroProfile Starter has generated this MicroProfile application for you.
The generation of the executable jar file can be performed by issuing the following command
mvn clean package
This will create an executable jar file eclipse-store.jar within the target maven folder. This can be started by executing the following command
java -jar target/eclipse-store.jar
During development, you can use Liberty's development mode (dev mode) to code while observing and testing your changes on the fly. With the dev mode, you can code along and watch the change reflected in the running server right away; unit and integration tests are run on pressing Enter in the command terminal; you can attach a debugger to the running server at any time to step through your code.
mvn liberty:dev
To launch the test page, open your browser at the following URL
http://localhost:9080/index.html
By default, there is always the creation of a JAX-RS application class to define the path on which the JAX-RS endpoints are available.
Also, a simple Hello world endpoint is created, have a look at the class HelloController.
More information on MicroProfile can be found here
Check the file "microprofile-config.properties" and comment on one of the "jnosql.document.provider" keys.
Couchbase Server, originally known as Membase, is an open-source, distributed multi-model NoSQL document-oriented database software package optimized for interactive applications. These applications may serve many concurrent users by creating, storing, retrieving, aggregating, manipulating and presenting data.
- Install docker: https://www.docker.com/
- https://hub.docker.com/r/couchbase/server/
- Run docker command:
docker run -d --name db -p 8091-8097:8091-8097 -p 9123:9123 -p 11207:11207 -p 11210:11210 -p 11280:11280 -p 18091-18097:18091-18097 couchbase
- Access: http://localhost:8091/ui/index.html
- Select the option "Setup New Cluster"
- Define "root" as Admin username
- Define "123456" as Password
- Define "localhost" as Cluster Name
- Accept the terms and conditions
- Go to "Buckets" session
- Create Bucket "beers" using the "Add Bucket" Option
- Click at "beers"
- Add "Hero" and "Villain" as Collection
- Go to Query session and execute: CREATE PRIMARY INDEX
#primary
ONfactory
._default
.beer
MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas.
- Install docker: https://www.docker.com/
- https://hub.docker.com/r/couchbase/server/
- Run docker command:
docker run -d --name mongodb-instance -p 27017:27017 mongo
Inserting:
curl --location --request POST 'http://localhost:9080/beers/random'
curl --location 'http://localhost:9080/beers/'
curl --location 'http://localhost:9080/beers/?page=1&hop=Magnum'
curl --location 'http://localhost:9080/beers/?page=1&hop=Magnum&malt=Vienna'