Files
helidon/examples/translator-app
2020-08-05 07:47:54 +00:00
..
2020-08-05 07:47:54 +00:00
2020-08-05 07:47:54 +00:00
2020-08-05 07:47:54 +00:00
2019-09-12 15:48:09 -07:00

Translator Example Application

This application demonstrates a pseudo application composed of two microservices implemented with Helidon SE.

Start Zipkin

With Docker:

docker run --name zipkin -d -p 9411:9411 openzipkin/zipkin

With Java 8+:

curl -sSL https://zipkin.io/quickstart.sh | bash -s
java -jar zipkin.jar

With Kubernetes:

kubectl apply -f ../k8s/ingress.yaml -f ../k8s/zipkin.yaml

Build and run

With Docker:

docker build -t helidon-examples-translator-backend backend/
docker build -t helidon-examples--translator-frontend frontend/
docker run --rm -d -p 9080:9080 \
    --link zipkin \
    --name helidon-examples-translator-backend \
     helidon-examples-translator-backend:latest
docker run --rm -d -p 8080:8080 \
    --link zipkin \
    --link helidon-examples-translator-backend \
    --name helidon-examples-translator-frontend \
     helidon-examples-translator-frontend:latest

With Java 8+:

mvn package
java -jar backend/target/helidon-examples-translator-backend.jar &
java -jar frontend/target/helidon-examples-translator-frontend.jar

Try the endpoint:

curl "http://localhost:8080?q=cloud&lang=czech"
curl "http://localhost:8080?q=cloud&lang=french"
curl "http://localhost:8080?q=cloud&lang=italian"

Then check out the traces at http://localhost:9411.

Run with Kubernetes (docker for desktop)

docker build -t helidon-examples-translator-backend backend/
docker build -t helidon-examples-translator-frontend frontend/
kubectl apply -f backend/app.yaml -f frontend/app.yaml

Try the endpoint:

curl "http://localhost/translator?q=cloud&lang=czech"
curl "http://localhost/translator?q=cloud&lang=french"
curl "http://localhost/translator?q=cloud&lang=italian"

Then check out the traces at http://localhost/zipkin.

Stop the docker containers:

docker stop zipkin \
    helidon-examples-translator-backend \
    helidon-examples-translator-frontend

Delete the Kubernetes resources:

kubectl delete -f backend/app.yaml -f frontend/app.yaml