akka/akka-core

Group router always drops first message

Offen

#31.297 geöffnet am 30.03.2022

 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Scala (3.547 Forks)batch import
1 - triagedhelp wantedt:typed

Repository-Metriken

Stars
 (13.277 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 8T 19h) (10 gemergte PRs in 30 T)

Beschreibung

Hello,

I have a cluster setup of 2 nodes. One node has service registered with services key over receptionist. Another node is using a group router to contact service on the first node.

Group router documentation has an example with the statement:

// the group router will stash messages until it sees the first listing of registered services from the 
// receptionist, so it is safe to send messages right away
for (int i = 0; i < 10; i++) {
    router.tell(new Worker.DoLog("msg " + i));
}

It states that it is safe to send messages immediately as they are stashed. But it behaves differently. Whenever a new group router is created, a new/first message gets dropped by the group router that is sent to the service right after the group router creation.

I also noted that subscriptions to the receptionist return 0 service instances on the first listing provided, while the node with the service is actually up and running. Only the second listing notification provides correct information. Seems like there is something to do with the receptionist and probably listing notifications.

Scala binary version 2.13 Akka version 2.6.19

Br, Alexander

Contributor Guide