Implementation of JSON-RPC protocol based on Quarkus microservice.
wcollections
git clone https://github.com/giosil/wcollections.git
mvn clean install
- this will publishwcollections-1.0.0.jar
in Maven local repository
The project was created with the following command:
quarkus create app org.dew.jsonrpc:micro-json-rpc --extension='resteasy-reactive-jsonb'
To consult the list of dependencies:
quarkus ext list
or simply:
quarkus ext
git clone https://github.com/giosil/micro-json-rpc.git
mvn clean install
git clone https://github.com/giosil/micro-json-rpc.git
quarkus build
Build a native executable:
quarkus build --native
Build a container friendly executable:
quarkus build --native -Dquarkus.native.container-build=true
quarkus dev
To enable debug :
quarkus dev -Dsuspend -Ddebug
Then, attach your debugger to localhost:5005.
POST http://localhost:8080/rpc
{
"id": 1,
"jsonrpc": "2.0",
"method": "DEMO.hello",
"params": ["world"]
}
{
"id": 1,
"jsonrpc": "2.0",
"method": "DEMO.helloObj",
"params": ["world"]
}
If you want to add a connection pool to a DBMS:
quarkus ext add io.quarkus:quarkus-agroal
This command inserts a new dependency into the pom.xml file
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-agroal</artifactId>
</dependency>
To remove the dependency:
quarkus ext remove io.quarkus:quarkus-agroal
Datasource configuration:
Edit file src/main/resources/application.properties
:
quarkus.datasource.db-kind=mariadb
quarkus.datasource.username=user
quarkus.datasource.password=password
quarkus.datasource.jdbc.url=jdbc:mariadb://localhost:3306/database
quarkus.datasource.jdbc.min-size=5
quarkus.datasource.jdbc.max-size=20
quarkus.datasource.jdbc.connection-timeout=5s