plant-name-parser-service
plant-name-parser-service - parse and provide structured view for plant names in string representation
In this project ANTLR v4 was used to implement name parser.
Development
Run configurations for IntelliJ Idea are here:
Service API
Docs
You can find here:
And in swagger: http://localhost:8080/swagger-ui.html
Monitoring
health check : http://localhost:8080/actuator/health
build info : http://localhost:8080/actuator/info
also, Spring Boot Actuator can be configured with additional reports
Requests
Example request
POST http://localhost:8080/api/v1/parseContent-Type: application/json
{ "text": "betula pendula"}
Example response
HTTP/1.1 200Content-Type: application/jsonTransfer-Encoding: chunkedDate: Wed, 10 Aug 2022 12:58:46 GMTKeep-Alive: timeout=60Connection: keep-alive
{"genus": {"text": "betula"},"species": {"text": "pendula"},"subspecies": null,"alternative": null,"variety": null,"cultivar": null,"form": null}
Error response
HTTP/1.1 500
Content-Length: 0
Date: Wed, 10 Aug 2022 13:00:35 GMT
Connection: close
<Response body is empty>
Docker
Build artifact
docker build --build-arg APPLICATION_VERSION="v1.0.0" -t plant-name-parser-service:v1.0.0 .
Run artifact
docker run -i -t --rm --name plant-name-parser-service -p 8080:8080 \ --memory=1G --cpus=1 \ plant-name-parser-service:v1.0.0
# Adjust system requirementsdocker run -i -t --rm --name plant-name-parser-service -p 8080:8080 \ --memory=2G --cpus=1 \ -e JAVA_OPTS="-Xms2G -Xmx2G -server" \ plant-name-parser-service:v1.0.0
Configuration with environment variables
PORT - default 8080
API_DOCS_ENABLED - enable api-docs, default true
MANAGEMENT_ENDPOINT_HEALTH - enable management health endpoint, default false
MANAGEMENT_ENDPOINT_INFO - enable management info endpoint, default false