File tree 2 files changed +28
-0
lines changed
src/main/java/ru/zhenik/akka/example/infrastructure/discovery
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## Application example
2
+
3
+ RESTapi service.
4
+
5
+ ### Tech stack
6
+
7
+ * [ Akka (actor, http, stream)] ( https://akka.io/ )
8
+ * [ Consul-client java] ( https://github.com/rickfast/consul-client )
9
+ * [ Shade plugin] ( https://maven.apache.org/plugins/maven-shade-plugin/ ) for fat-jar
10
+ * Java 8
11
+ * Docker
12
+
13
+ ### REST
14
+
15
+ | REQUEST | RESPONSE |
16
+ | ------------- | :-------------: |
17
+ | GET /health | 200 OK and app-id |
18
+ | POST /app | 200 OK |
19
+
20
+
21
+ ### Notes
22
+
23
+ Pay attention to config file ` application.conf ` , it is loaded by [ typesafe config] ( https://github.com/lightbend/config ) .
24
+
25
+ ` DiscoveryAgentActor ` responsible for registration this app instance in consul and send each (10 sec default) health check to consul.
26
+
27
+
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ public Receive createReceive() {
76
76
// send each (10seconds default) health-check to consul
77
77
.scheduler ()
78
78
.schedule (
79
+ // delay before 1st request
79
80
new FiniteDuration (5 , TimeUnit .SECONDS ),
80
81
SCHEDULED_WORK_DELAY ,
81
82
healthCheck (),
You can’t perform that action at this time.
0 commit comments