Service not found. Hint: Maybe it was not registered?

@dheeraj you need to handle service query failures (service not found, connection failure,…) in your actor.

You have two options:

  1. handling failure in actor
  2. using backoff + cluster singleton

#1) actor message flow is controling service query lifecycle
Service query result should be piped (Use the pipe pattern to actor.
Actor should have two behaviors (see - not-ready and ready.
Initial state is not-ready. In preStart you query the service and pipe result to actor. In case of failure you schedule, with short delay, a next query.
In case of success you would change behavior to ready.
Only ready behaviour accepts consumed messages from kafka.

#2) wrap your actor in backoff and cluster singleton.
In case of service query failure actor should stop and Backoff will restart the actor and query will be repeated.
Check Akka supervision for referenced implementation.
When using backoff you do not have access to your actor ActorRef to send consumed messages so you would need cluster singleton (cluster singleton client) for that.
Check Cluster singleton
Here is an example but in java.
I would not sugget this option because of scalability issues.

Note: When consuming message and sending it to an actor, I suggest you implement ask rather then tell so you can get a back-pressure and if actor is not ready messges can be resent (if you require at least once semantic).

Hope this helps.