I've got two console apps that both connect successfully to lighthouse to join a cluster. I would like to publish messages from actors in one console app to actors in the other.
In the "from" console app
var mediator = DistributedPubSub.Get(_actorSystem).Mediator;
mediator.Tell(new ClusterClient.Publish("topic-foo", "my message"));
In an actor in the "to" console app
public RaspberryPiActor()
{
var mediator = DistributedPubSub.Get(Context.System).Mediator;
mediator.Tell(new Subscribe("topic-foo", Self));
Receive<SubscribeAck>(_ => Become(Subscribed));
}
private void Subscribed()
{
Receive<string>(m =>
{
Console.WriteLine(m);
});
}
Am I doing something that is evidently wrong?