You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying from past one week to get a simple setup working. I have installed the LightHouse as windows service (running on 127.0.0.1:4053) and updated the Actor system name to match other. I have command line tool 'MessageGateway' which starts up the ActorSystem (DeviceMessageProcessor) and here is hocon config of MessageGateway, akka { loglevel = DEBUG loggers = ["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"] actor { provider = cluster deployment { /pingreport { router = round-robin-pool nr-of-instances = 2 } } } remote { log-remote-lifecycle-events = DEBUG dot-netty.tcp { port = 0 hostname = "127.0.0.1" } } cluster { seed-nodes = ["akka.tcp://DeviceMessageProcessor@127.0.0.1:4053"] } }
And I have MessageGatewayAPI VS Project, which creates the actor to send a message to actor '/user/pingreport', here is the hocon config of MessageGatewayAPI, akka { loglevel = DEBUG loggers = ["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"] actor { provider = cluster } remote { log-remote-lifecycle-events = DEBUG dot-netty.tcp { port = 0 hostname = "127.0.0.1" } } cluster { seed-nodes = ["akka.tcp://DeviceMessageProcessor@127.0.0.1:4053"] } }
Every time I send message from MessageGatewayAPI actor to MessageGateway actor ('/user/pingreport'), it goes to DeadLetters. I have not seeing any logs which is helpful to debug this issue. Please please, try to help us here. I have been pouring ton of time and I am not moving forward.
Akka.Net Version: 1.3.12
ASP.NET CORE 2.0
Below is the code which tries to send a message,
public class MessageGatewayApiActor: ReceiveActor
{
private readonly ILoggingAdapter _logger = Context.GetLogger();
private readonly ActorSelection _gateway = Context.ActorSelection("/user/pingreport");
public MessageGatewayApiActor()
{
Receive<GatewayPingReport>(req =>
{
_logger.Info("Sending PingReport request with message '{PingMessage}'", req.PingMessage);
_gateway.Tell(new PingReport(req.PingMessage));
});
}
}
The text was updated successfully, but these errors were encountered:
If you're using a relative path ("/user/pingreport") in your actor selection, it will assume, that the base path you want to use, is the address of your current node. This means that pingreport actor must live on the same node as MessageGatewayApiActor.
If you want to send to send a message to an actor living on another node, you first need to specify what node are you interested in. Also it's bad practice to use ActorSelection if all you need is to address the same actor every time.
The usual practice is to distinguish the nodes presenting different behaviors by assigning them different roles - this can be done by akka.cluster.roles = [ "role1", "role2" ] in HOCON config. All nodes having the same role should expose the same capability.
Now you can interact with the cluster using Akka.Cluster.Cluster class. Example:
varcluster= Cluster.Get(actorSystem);varnodes= cluster.State.Members.Where(member => member.Roles.Contains("role1"));foreach(var node in nodes)varactorSelection= actorSystem.ActorSelection(node.Address.ToString()+"/user/pingreport");// check if actor is alive under given selectionvaractorRef=await actorSelection.ResolveOne(timeout: TimeSpan.FromSeconds(10));
@OmniAsetty so, is the issue resolved now?
I believe the recommendations @Horusiath gave above, especially the fact that you need to specify actor's node address to be able to use it's relative path, should help.
I am trying from past one week to get a simple setup working. I have installed the LightHouse as windows service (running on 127.0.0.1:4053) and updated the Actor system name to match other. I have command line tool 'MessageGateway' which starts up the ActorSystem (DeviceMessageProcessor) and here is hocon config of MessageGateway,
akka { loglevel = DEBUG loggers = ["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"] actor { provider = cluster deployment { /pingreport { router = round-robin-pool nr-of-instances = 2 } } } remote { log-remote-lifecycle-events = DEBUG dot-netty.tcp { port = 0 hostname = "127.0.0.1" } } cluster { seed-nodes = ["akka.tcp://DeviceMessageProcessor@127.0.0.1:4053"] } }
And I have MessageGatewayAPI VS Project, which creates the actor to send a message to actor '/user/pingreport', here is the hocon config of MessageGatewayAPI,
akka { loglevel = DEBUG loggers = ["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"] actor { provider = cluster } remote { log-remote-lifecycle-events = DEBUG dot-netty.tcp { port = 0 hostname = "127.0.0.1" } } cluster { seed-nodes = ["akka.tcp://DeviceMessageProcessor@127.0.0.1:4053"] } }
Every time I send message from MessageGatewayAPI actor to MessageGateway actor ('/user/pingreport'), it goes to DeadLetters. I have not seeing any logs which is helpful to debug this issue. Please please, try to help us here. I have been pouring ton of time and I am not moving forward.
Akka.Net Version: 1.3.12
ASP.NET CORE 2.0
Below is the code which tries to send a message,
The text was updated successfully, but these errors were encountered: