Crazy basic microservice, for simple experimentation
The microservice will
- wait for simple character "events"
- e.g. when an event of Alphabet letter occurs, the microservice will emit an "event" of <A+1>
-> this is the "business logic"
- ideally, I will just paramaterize the input letter and resulting output letter
- e.g. when an event of Alphabet letter occurs, the microservice will emit an "event" of <A+1>
-> this is the "business logic"
The implementation will initially work using NATS
- later I would like to switch the implementation to use RabbitMQ / Kafka etc
- will aim to keep the implementation detail away from the "business logic"
I need to orchestrate up multiple instances of the microservices - let's say just spin up 5 instances for starters - from 2 instances first...
I would like to orchestrate this with docker first
- then later minikube?
- also look for a chance to "use" Chef / Terraform too
Instructions: So far this much is working:
-
start up the nats server as per the doc here https://www.nats.io/documentation/tutorials/gnatsd-docker/ (after the first time, docker start / stop should work)
- you could run against the public nats demo server
-
run the java application to run from command line:
java -cp target/basic-microservice-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.stevenson.basicmicroservice.Application alphabet.A C
-
telnet to the nats server, and publish messages e.g.
telnet 4222 pub alphabet.A 1 A
-
Observe the microservice's behaviour