https://github.com/rgolangh/msg-logger-thorntail-demo
https://github.com/rgolangh/msg-logger-thorntail-demo
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/rgolangh/msg-logger-thorntail-demo
- Owner: rgolangh
- Archived: true
- Created: 2019-01-05T13:44:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-06T11:54:48.000Z (over 6 years ago)
- Last Synced: 2025-02-18T21:13:39.363Z (3 months ago)
- Language: Java
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# msg-logger-thorntail-demo
A simple JAX-RS + Datasource thorntail app, with a simple REST-API endpint to consume message, persists them to postgres and can retrive them.### Build
```console
$ mvn package$ docker build . -t msg-logger-thorntail-demo
```### Run
```console
$ docker run --rm -it -p 8080:8080 msg-logger-thorntail-demo```console
# persist a message to postgres db
$ curl "http://localhost:8080/messages/send?username=rgo&message=hacking"
```
```console
# get all messages
$ curl -s http://localhost:8080/messages
{rgo: hacking}
```### Tweak the db connection string
To tweak the db location, invoke the conatiner extra arguments, it will be picked thanks to microprofile-config api
```console
$ docker run \
-it \
--link postgresql-container-name=postgres \
msg-logger-thorntail-demo \
-Dthorntail.datasources.data-sources.ExampleDS.connection-url=jdbc:postgresql://postgres:5432/testdb
```