Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/giosil/micro-json-rpc
Implementation of JSON-RPC protocol based on Quarkus microservice.
https://github.com/giosil/micro-json-rpc
json-rpc json-rpc-server json-rpc2 microservices quarkus
Last synced: 7 days ago
JSON representation
Implementation of JSON-RPC protocol based on Quarkus microservice.
- Host: GitHub
- URL: https://github.com/giosil/micro-json-rpc
- Owner: giosil
- License: apache-2.0
- Created: 2023-10-31T16:11:51.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-13T16:25:05.000Z (about 1 year ago)
- Last Synced: 2024-11-07T06:18:00.309Z (about 2 months ago)
- Topics: json-rpc, json-rpc-server, json-rpc2, microservices, quarkus
- Language: HTML
- Homepage:
- Size: 222 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# micro-json-rpc
Implementation of JSON-RPC protocol based on Quarkus microservice.
## Dependencies
**wcollections**
- `git clone https://github.com/giosil/wcollections.git`
- `mvn clean install` - this will publish `wcollections-1.0.0.jar` in Maven local repository## Quarkus usage
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`
## Build with Maven
- `git clone https://github.com/giosil/micro-json-rpc.git`
- `mvn clean install`## Build with Quarkus
- `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`
## Run in development mode
- `quarkus dev`
To enable debug :
- `quarkus dev -Dsuspend -Ddebug`
Then, attach your debugger to localhost:5005.
## Test
POST `http://localhost:8080/rpc`
```json
{
"id": 1,
"jsonrpc": "2.0",
"method": "DEMO.hello",
"params": ["world"]
}
``````json
{
"id": 1,
"jsonrpc": "2.0",
"method": "DEMO.helloObj",
"params": ["world"]
}
```## Connection pool
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
```xml
io.quarkus
quarkus-agroal
```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
```## License
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
## Contributors
* [Giorgio Silvestris](https://github.com/giosil)