I'm looking for a framework/platform to (easily) support cross microservices communication. I was guided to look into Akka with Kafka. Unfortunately I was unable to find specifically this set-up and use case, but also didn't find any specific messages that can say it will not work. Based on articles/messages here and on other sites I've compiled set of expectation from Akka + Kafka with a few open points.
Could you please review/correct the points below?
- Platform for Microservices “cluster” implementation.
Microservices “cluster” is system implemented with set of
Microservices [application]
- a. Microservices interact with each other by means of AKKA messaging API. (e.g. tell, ask)
- b. There can be multiple instances of Microservice
- i. Q: Is mailbox shared between instances (of one microservice=Actor)?
AKKA can be connected to Kafka and use it as transport (Message Broker), i.e. Kafka API is encapsulated into AKKA API
- a. Q: What are the values from Kafka? E.g. performance, throughput, reliability. Why Akka remoting is not enough?
Messaging
- a. First, some initialization is needed:
- i. e.g. create Actors System, supervisor
- ii. There should be some shared pre-configuration between all Microservices (Actors in the cluster). E.g. IP/URI, message types/cases, etc.
- b. Worker-Actors can be added/instantiated in run time: i. Find supervisor by name/URI ii. Add Work-Actor as child
- c. There is ability to broadcast message to all children (e.g. specified by name and wildcards) and wait for responses from all children. Hower it seems it is not "native" for Akka API and code doesn't look as clear enough (samples at stackoverlow: 1, 2)
- d. There is no ability to subscribe to certain type of events i.e. define filtering conditions during subscription, in case of filtering is needed – it can be done only inside each actor in onReceive method. So, in case of broadcasting each Actor will receive message and than need to decide whether it is applicable for him or not.
- e. Q: what are message tracing/debugging tools/capabilities available in Akka?
- a. First, some initialization is needed:
- Actors execution can be “chained”: E.g. A->B->C, in this case after processing C and B control will be passed back (in case of “ask” method)
- AKKA Cluster
- a. Provides APIs for app lifecycle mgmt.: start all/start one/stop/scale etc.
- Q: how I can support/implement graceful shutdown?
- b. It has built-in monitoring capabilities (check app availability, health etc.)
- c. Q: What about Infrastructure Monitoring? Do I need to care about it?
- d. Q: Is ConductR is a must or just nice to have?
- a. Provides APIs for app lifecycle mgmt.: start all/start one/stop/scale etc.
- Service Discovery (e.g. Eureka) is not needed, since we use reactive communications (async. Messages via Message Broker)
- a. Q: What about affinity/stickiness? Do I need to care about it? What Akka can offer in this area?
- b. Q: How balancing is done?
In addition, if AKKA can really work on underlying Kafka - is there good example? I found only samples with data streaming, but I need just event/message processing.