I am running into an issue implementing the Akka Cluster Client, as it seems the ClusterClient never actually sends a GetContacts message, even though it is indicating that it is sending it (in Debug Logs).
I am confident that the message is not being sent as I am running a network capture between the box where the Server (Receptionist) is running and where the Client (ClusterClient) is running, and I see no packets on the indicated port where the ClusterClient is supposedly sending.
I have looked at all the configs numerous times, and I cannot see anything wrong, and the fact that the logs indicate the GetContacts is being sent, but nothing hits the network has me completely confused.
The Server Logs no messages or errors after it initializes and the 8092 port is listening (I see it in netstat, and I can telnet to it). It just seems that the client never actually sends a message to the Server port 8092. I have also tried running this on a localsystem using 127.0.0.1 as the Hostname for both server and client, and I see the same issue, no packets getting sent from Client process to Server process.
Here are the client logs, which includes the akka HOCON config. The GetContacts keeps repeating, and several seconds after initiation (7:46:24) the Client attempts to use the ClusterClient to send a message, however it receives "Receptionist not available, buffering message type..."
Server Logs and Code are below Client Logs and Code
Client Debug Logs
2017-08-30 07:46:19.4991 Akka.Event.EventStream 6 Default Loggers started
2017-08-30 07:46:19.4991 Akka.Event.LoggingBus+UnhandledMessageForwarder 6 Started (Akka.Event.LoggingBus+UnhandledMessageForwarder)
2017-08-30 07:46:19.4991 Akka.Event.DummyClassForStringSources 6 Starting remoting
2017-08-30 07:46:19.4991 Akka.Actor.SystemGuardianActor 6 now supervising akka://ClientSystem/system/remoting-terminator
2017-08-30 07:46:19.4991 Akka.Actor.SystemGuardianActor 6 now supervising akka://ClientSystem/system/transports
2017-08-30 07:46:19.4991 Akka.Actor.SystemGuardianActor 6 now supervising akka://ClientSystem/system/endpointManager
2017-08-30 07:46:19.4991 Akka.Remote.TransportSupervisor 6 Started (Akka.Remote.TransportSupervisor)
2017-08-30 07:46:19.4991 Akka.Event.DummyClassForStringSources 6 Starting prune timer for endpoint manager...
2017-08-30 07:46:19.4991 Akka.Remote.EndpointManager 6 Started (Akka.Remote.EndpointManager)
2017-08-30 07:46:19.4991 Akka.Remote.RemoteActorRefProvider+RemotingTerminator 6 Started (Akka.Remote.RemoteActorRefProvider+RemotingTerminator)
2017-08-30 07:46:19.4991 Akka.Remote.RemoteActorRefProvider+RemotingTerminator 6 now watched by [akka://ClientSystem/system]
2017-08-30 07:46:19.4991 Akka.Remote.Transport.AkkaProtocolManager 6 Started (Akka.Remote.Transport.AkkaProtocolManager)
2017-08-30 07:46:19.4991 Akka.Remote.TransportSupervisor 6 now supervising akka://ClientSystem/system/transports/akkaprotocolmanager.tcp.0
2017-08-30 07:46:19.4991 Akka.Event.DummyClassForStringSources 6 Remoting started; listening on addresses : [akka.tcp://[email protected]:23695]
2017-08-30 07:46:19.4991 Akka.Event.DummyClassForStringSources 6 Remoting now listens on addresses: [akka.tcp://[email protected]:23695]
2017-08-30 07:46:19.5191 Akka.Event.DummyClassForStringSources 5 Cluster Node [akka.tcp://[email protected]:23695] - Starting up...
2017-08-30 07:46:19.5191 Akka.Actor.SystemGuardianActor 3 now supervising akka://ClientSystem/system/cluster
2017-08-30 07:46:19.5301 Akka.Actor.SystemGuardianActor 3 now supervising akka://ClientSystem/system/clusterEventBusListener
2017-08-30 07:46:19.5452 Akka.Cluster.ClusterDaemon 8 Started (Akka.Cluster.ClusterDaemon)
2017-08-30 07:46:19.5452 Akka.Cluster.ClusterDaemon 8 now supervising akka://ClientSystem/system/cluster/core
2017-08-30 07:46:19.5452 Akka.Cluster.ClusterDaemon 8 now supervising akka://ClientSystem/system/cluster/heartbeatReceiver
2017-08-30 07:46:19.5452 Akka.Cluster.ClusterCoreSupervisor 6 Started (Akka.Cluster.ClusterCoreSupervisor)
2017-08-30 07:46:19.5452 Akka.Cluster.ClusterHeartbeatReceiver 5 Started (Akka.Cluster.ClusterHeartbeatReceiver)
2017-08-30 07:46:19.5693 Akka.Event.DummyClassForStringSources 6 Cluster Node [akka.tcp://[email protected]:23695] - Started up successfully
2017-08-30 07:46:19.5693 Akka.Cluster.ClusterCoreSupervisor 6 now supervising akka://ClientSystem/system/cluster/core/publisher
2017-08-30 07:46:19.5693 Akka.Cluster.ClusterCoreSupervisor 6 now supervising akka://ClientSystem/system/cluster/core/daemon
2017-08-30 07:46:19.5693 Akka.Actor.SystemGuardianActor 5 now supervising akka://ClientSystem/system/remote-watcher
2017-08-30 07:46:19.5693 Akka.Actor.SystemGuardianActor 5 now supervising akka://ClientSystem/system/remote-deployment-watcher
2017-08-30 07:46:19.5693 Akka.Actor.SystemGuardianActor 21 now supervising akka://ClientSystem/system/deadLetterListener
2017-08-30 07:46:19.5693 Akka.Event.EventStream 5 subscribing [akka://ClientSystem/system/deadLetterListener#1224522872] to channel Akka.Event.DeadLetter
2017-08-30 07:46:19.5693 Akka.Event.DeadLetterListener 5 Started (Akka.Event.DeadLetterListener)
2017-08-30 07:46:19.5693 Akka.Remote.RemoteDeploymentWatcher 5 Started (Akka.Remote.RemoteDeploymentWatcher)
2017-08-30 07:46:19.5693 Akka.Actor.SystemGuardianActor 19 now supervising akka://ClientSystem/system/EventStreamUnsubscriber-1
2017-08-30 07:46:19.5693 Akka.Event.EventStreamUnsubscriber 21 registering unsubscriber with Akka.Event.EventStream
2017-08-30 07:46:19.5693 Akka.Actor.Internal.ActorSystemImpl 3 NewtonSoftJsonSerializer has been detected as a default serializer. It will be obsoleted in Akka.NET starting from version 1.5 in the favor of Hyperion (for more info visit: http://getakka.net/docs/Serialization#how-to-setup-hyperion-as-default-serializer ). If you want to suppress this message set HOCON `akka.suppress-json-serializer-warning` config flag to on.
2017-08-30 07:46:19.5793 Akka.Event.EventStreamUnsubscriber 3 Started (Akka.Event.EventStreamUnsubscriber)
2017-08-30 07:46:19.5793 Akka.Cluster.ClusterDomainEventPublisher 3 Started (Akka.Cluster.ClusterDomainEventPublisher)
2017-08-30 07:46:19.5793 Akka.Actor.Internal.ActorSystemImpl 3 akka : {
log-config-on-start : on
stdout-loglevel : DEBUG
loglevel : DEBUG
loggers : ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"]
actor : {
serialize-messages : on
serialize-creators : on
provider : "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
debug : {
receive : on
autoreceive : on
lifecycle : on
event-stream : on
unhandled : on
}
}
remote : {
log-received-messages : on
log-sent-messages : on
enabled-transports : [akka.remote.dot-netty.tcp]
dot-netty : {
tcp : {
transport-protocol : tcp
port : 0
hostname : 10.20.123.42
}
}
log-remote-lifecycle-events : DEBUG
}
cluster : {
client : {
initial-contacts : ["akka.tcp://[email protected]:8092/system/receptionist"]
}
}
}
2017-08-30 07:46:19.5793 Akka.Actor.GuardianActor 3 now supervising akka://ClientSystem/user/ordertracker
2017-08-30 07:46:19.5793 Akka.Event.EventStream 3 subscribing [akka://ClientSystem/system/cluster/core/daemon#1545645994] to channel Akka.Remote.QuarantinedEvent
2017-08-30 07:46:19.5793 Akka.Cluster.ClusterCoreDaemon 3 No seed-nodes configured, manual cluster join required
2017-08-30 07:46:19.5793 Akka.Cluster.ClusterCoreDaemon 3 Started (Akka.Cluster.ClusterCoreDaemon)
2017-08-30 07:46:19.5793 Akka.Cluster.ClusterCoreDaemon 3 now watched by [akka://ClientSystem/system/cluster/core#515725268]
2017-08-30 07:46:19.5943 ClientPump.OrderTracker 5 Order Tracker Started
2017-08-30 07:46:19.5943 ClientPump.OrderTracker 19 Started (ClientPump.OrderTracker)
2017-08-30 07:46:19.5943 ClientPump.OrderTracker 19 now supervising akka://ClientSystem/user/ordertracker/crouter
2017-08-30 07:46:19.5943 Akka.Cluster.Tools.Client.ClusterClient 8 Sending GetContacts to [ActorSelection[Anchor(akka.tcp://[email protected]:8092/), Path(/system/receptionist)]]
2017-08-30 07:46:19.5943 Akka.Cluster.Tools.Client.ClusterClient 5 Started (Akka.Cluster.Tools.Client.ClusterClient)
2017-08-30 07:46:19.6074 Akka.Cluster.Tools.Client.ClusterClient 19 Sending GetContacts to [ActorSelection[Anchor(akka.tcp://[email protected]:8092/), Path(/system/receptionist)]]
2017-08-30 07:46:19.6074 Akka.Remote.EndpointManager 8 now supervising akka://ClientSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FNGOMSCluster%4010.20.223.45%3A8092-1
2017-08-30 07:46:19.6074 Akka.Remote.ReliableDeliverySupervisor 5 Started (Akka.Remote.ReliableDeliverySupervisor)
2017-08-30 07:46:19.6074 Akka.Remote.ReliableDeliverySupervisor 5 now watched by [akka://ClientSystem/system/endpointManager#268440055]
2017-08-30 07:46:19.6074 Akka.Remote.ReliableDeliverySupervisor 5 now supervising akka://ClientSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FNGOMSCluster%4010.20.223.45%3A8092-1/endpointWriter
2017-08-30 07:46:19.6074 Akka.Remote.EndpointWriter 19 Started (Akka.Remote.EndpointWriter)
2017-08-30 07:46:19.6074 Akka.Remote.EndpointWriter 19 now watched by [akka://ClientSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FNGOMSCluster%4010.20.223.45%3A8092-1#1733941078]
2017-08-30 07:46:19.6384 Akka.Cluster.ClusterRemoteWatcher 8 Started (Akka.Cluster.ClusterRemoteWatcher)
2017-08-30 07:46:19.6384 Akka.Cluster.ClusterReadView+EventBusListener 5 Started (Akka.Cluster.ClusterReadView+EventBusListener)
2017-08-30 07:46:19.6384 Akka.Cluster.ClusterCoreDaemon 19 [Uninitialized] Received Akka.Cluster.InternalClusterAction+Subscribe
2017-08-30 07:46:19.6384 Akka.Cluster.ClusterCoreDaemon 20 [Uninitialized] Received Akka.Cluster.InternalClusterAction+Subscribe
2017-08-30 07:46:19.6856 Akka.Event.EventStream 6 subscribing [akka://ClientSystem/system/remote-watcher#92163059] to channel Akka.Cluster.ClusterEvent+IMemberEvent
2017-08-30 07:46:19.6856 Akka.Event.EventStream 4 subscribing [akka://ClientSystem/system/clusterEventBusListener#2106616419] to channel Akka.Cluster.ClusterEvent+IClusterDomainEvent
2017-08-30 07:46:22.6062 Akka.Cluster.Tools.Client.ClusterClient 3 Sending GetContacts to [ActorSelection[Anchor(akka.tcp://[email protected]:8092/), Path(/system/receptionist)]]
2017-08-30 07:46:24.1453 ClientPump.OrderTracker 3 Send Order Received, will try to send to akka://ClientSystem
2017-08-30 07:46:24.1524 Akka.Cluster.Tools.Client.ClusterClient 19 Receptionist not available, buffering message type [SendToAll]
2017-08-30 07:46:24.1524 Akka.Cluster.Tools.Client.ClusterClient 6 Receptionist not available, buffering message type [Send]
2017-08-30 07:46:24.1524 ClientPump.OrderTracker 6 received handled message ClientPump.SendOrder from akka://ClientSystem/deadLetters
2017-08-30 07:46:25.6163 Akka.Cluster.Tools.Client.ClusterClient 3 Sending GetContacts to [ActorSelection[Anchor(akka.tcp://[email protected]:8092/), Path(/system/receptionist)]]
2017-08-30 07:46:28.6254 Akka.Cluster.Tools.Client.ClusterClient 8 Sending GetContacts to [ActorSelection[Anchor(akka.tcp://[email protected]:8092/), Path(/system/receptionist)]]
2017-08-30 07:46:31.6354 Akka.Cluster.Tools.Client.ClusterClient 20 Sending GetContacts to [ActorSelection[Anchor(akka.tcp://[email protected]:8092/), Path(/system/receptionist)]]
2017-08-30 07:46:34.6464 Akka.Cluster.Tools.Client.ClusterClient 4 Sending GetContacts to [ActorSelection[Anchor(akka.tcp://[email protected]:8092/), Path(/system/receptionist)]]
2017-08-30 07:46:37.6555 Akka.Cluster.Tools.Client.ClusterClient 20 Sending GetContacts to [ActorSelection[Anchor(akka.tcp://[email protected]:8092/), Path(/system/receptionist)]]
2017-08-30 07:46:40.6665 Akka.Cluster.Tools.Client.ClusterClient 6 Sending GetContacts to [ActorSelection[Anchor(akka.tcp://[email protected]:8092/), Path(/system/receptionist)]]
2017-08-30 07:46:43.6764 Akka.Cluster.Tools.Client.ClusterClient 21 Sending GetContacts to [ActorSelection[Anchor(akka.tcp://[email protected]:8092/), Path(/system/receptionist)]]
Client Code
class OrderTracker : ReceiveActor, ILogReceive
{
private static NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
public OrderTracker()
{
var settings = ClusterClientSettings.Create(Context.System);
var clusterClient = Context.ActorOf(ClusterClient.Props(settings), "crouter");
log.Info("Order Tracker Started");
Receive<OrderMessage>(o =>
{
log.Info(o.ClientID + "," + o.OrderID.ToString() + "," + o.State.ToString() + "," + o.Side.ToString() + "," + o.Symbol + "," + o.Price.ToString() + "," + o.Quantity.ToString());
});
Receive<SendOrder>(o =>
{
log.Info("Send Order Received, will try to send to " + clusterClient.Path.Address.ToString());
clusterClient.Tell(new ClusterClient.SendToAll("/user/manager/client", o.Message));
clusterClient.Tell(new ClusterClient.Send("/user/manager/client", o.Message));
});
}
}
}
Server Logs
2017-08-30 07:44:48.1624 Akka.Event.LoggingBus+UnhandledMessageForwarder 6 Started (Akka.Event.LoggingBus+UnhandledMessageForwarder)
2017-08-30 07:44:48.1624 Akka.Event.EventStream 6 Default Loggers started
2017-08-30 07:44:48.1624 Akka.Actor.SystemGuardianActor 6 now supervising akka://NGOMSCluster/system/remoting-terminator
2017-08-30 07:44:48.1624 Akka.Actor.SystemGuardianActor 6 now supervising akka://NGOMSCluster/system/transports
2017-08-30 07:44:48.1624 Akka.Event.DummyClassForStringSources 6 Starting remoting
2017-08-30 07:44:48.1624 Akka.Remote.TransportSupervisor 6 Started (Akka.Remote.TransportSupervisor)
2017-08-30 07:44:48.1624 Akka.Actor.SystemGuardianActor 6 now supervising akka://NGOMSCluster/system/endpointManager
2017-08-30 07:44:48.1624 Akka.Remote.RemoteActorRefProvider+RemotingTerminator 6 Started (Akka.Remote.RemoteActorRefProvider+RemotingTerminator)
2017-08-30 07:44:48.1624 Akka.Event.DummyClassForStringSources 6 Starting prune timer for endpoint manager...
2017-08-30 07:44:48.1624 Akka.Remote.EndpointManager 6 Started (Akka.Remote.EndpointManager)
2017-08-30 07:44:48.1624 Akka.Remote.RemoteActorRefProvider+RemotingTerminator 6 now watched by [akka://NGOMSCluster/system]
2017-08-30 07:44:48.1724 Akka.Remote.Transport.AkkaProtocolManager 6 Started (Akka.Remote.Transport.AkkaProtocolManager)
2017-08-30 07:44:48.1724 Akka.Remote.TransportSupervisor 6 now supervising akka://NGOMSCluster/system/transports/akkaprotocolmanager.tcp.0
2017-08-30 07:44:48.1724 Akka.Event.DummyClassForStringSources 6 Remoting started; listening on addresses : [akka.tcp://[email protected]:8092]
2017-08-30 07:44:48.1724 Akka.Event.DummyClassForStringSources 6 Remoting now listens on addresses: [akka.tcp://[email protected]:8092]
2017-08-30 07:44:48.1724 Akka.Event.DummyClassForStringSources 6 Cluster Node [akka.tcp://[email protected]:8092] - Starting up...
2017-08-30 07:44:48.1724 Akka.Actor.SystemGuardianActor 6 now supervising akka://NGOMSCluster/system/cluster
2017-08-30 07:44:48.1724 Akka.Actor.SystemGuardianActor 6 now supervising akka://NGOMSCluster/system/clusterEventBusListener
2017-08-30 07:44:48.1884 Akka.Cluster.ClusterDaemon 5 Started (Akka.Cluster.ClusterDaemon)
2017-08-30 07:44:48.1884 Akka.Cluster.ClusterDaemon 5 now supervising akka://NGOMSCluster/system/cluster/core
2017-08-30 07:44:48.1884 Akka.Cluster.ClusterDaemon 5 now supervising akka://NGOMSCluster/system/cluster/heartbeatReceiver
2017-08-30 07:44:48.1884 Akka.Cluster.ClusterCoreSupervisor 5 Started (Akka.Cluster.ClusterCoreSupervisor)
2017-08-30 07:44:48.1884 Akka.Cluster.ClusterHeartbeatReceiver 5 Started (Akka.Cluster.ClusterHeartbeatReceiver)
2017-08-30 07:44:48.2084 Akka.Cluster.ClusterCoreSupervisor 7 now supervising akka://NGOMSCluster/system/cluster/core/publisher
2017-08-30 07:44:48.2084 Akka.Event.DummyClassForStringSources 7 Cluster Node [akka.tcp://[email protected]:8092] - Started up successfully
2017-08-30 07:44:48.2084 Akka.Cluster.ClusterCoreSupervisor 7 now supervising akka://NGOMSCluster/system/cluster/core/daemon
2017-08-30 07:44:48.2084 Akka.Cluster.ClusterReadView+EventBusListener 7 Started (Akka.Cluster.ClusterReadView+EventBusListener)
2017-08-30 07:44:48.2084 Akka.Actor.SystemGuardianActor 7 now supervising akka://NGOMSCluster/system/remote-watcher
2017-08-30 07:44:48.2084 Akka.Actor.SystemGuardianActor 7 now supervising akka://NGOMSCluster/system/remote-deployment-watcher
2017-08-30 07:44:48.2084 Akka.Cluster.ClusterDomainEventPublisher 7 Started (Akka.Cluster.ClusterDomainEventPublisher)
2017-08-30 07:44:48.2084 Akka.Remote.RemoteDeploymentWatcher 7 Started (Akka.Remote.RemoteDeploymentWatcher)
2017-08-30 07:44:48.2084 Akka.Cluster.ClusterRemoteWatcher 4 Started (Akka.Cluster.ClusterRemoteWatcher)
2017-08-30 07:44:48.2084 Akka.Event.EventStream 20 subscribing [akka://NGOMSCluster/system/cluster/core/daemon#658632128] to channel Akka.Remote.QuarantinedEvent
2017-08-30 07:44:48.2084 Akka.Cluster.ClusterCoreDaemon 20 Started (Akka.Cluster.ClusterCoreDaemon)
2017-08-30 07:44:48.2084 Akka.Cluster.ClusterCoreDaemon 20 now watched by [akka://NGOMSCluster/system/cluster/core#1737578814]
2017-08-30 07:44:48.2194 Akka.Cluster.ClusterCoreDaemon 20 [Uninitialized] Received Akka.Cluster.InternalClusterAction+Subscribe
2017-08-30 07:44:48.2194 Akka.Cluster.ClusterCoreDaemon 20 [Uninitialized] Received Akka.Cluster.InternalClusterAction+Subscribe
2017-08-30 07:44:48.2194 Akka.Cluster.ClusterCoreDaemon 20 [Uninitialized] Received Akka.Cluster.InternalClusterAction+JoinSeedNodes
2017-08-30 07:44:48.2194 Akka.Cluster.ClusterCoreDaemon 6 [Uninitialized] Received Akka.Cluster.ClusterUserAction+JoinTo
2017-08-30 07:44:48.2194 Akka.Actor.SystemGuardianActor 7 now supervising akka://NGOMSCluster/system/distributedPubSubMediator
2017-08-30 07:44:48.2454 Akka.Actor.Internal.ActorSystemImpl 7 NewtonSoftJsonSerializer has been detected as a default serializer. It will be obsoleted in Akka.NET starting from version 1.5 in the favor of Hyperion (for more info visit: http://getakka.net/docs/Serialization#how-to-setup-hyperion-as-default-serializer ). If you want to suppress this message set HOCON `akka.suppress-json-serializer-warning` config flag to on.
2017-08-30 07:44:48.2524 Akka.Cluster.Tools.PublishSubscribe.DistributedPubSubMediator 7 Started (Akka.Cluster.Tools.PublishSubscribe.DistributedPubSubMediator)
2017-08-30 07:44:48.2524 Akka.Actor.SystemGuardianActor 7 now supervising akka://NGOMSCluster/system/receptionist
2017-08-30 07:44:48.2524 Akka.Actor.SystemGuardianActor 7 now supervising akka://NGOMSCluster/system/deadLetterListener
2017-08-30 07:44:48.2524 Akka.Actor.SystemGuardianActor 7 now supervising akka://NGOMSCluster/system/EventStreamUnsubscriber-1
2017-08-30 07:44:48.2524 Akka.Actor.Internal.ActorSystemImpl 7 akka : {
log-config-on-start : on
stdout-loglevel : DEBUG
loglevel : DEBUG
loggers : ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"]
extensions : ["Akka.Cluster.Tools.Client.ClusterClientReceptionistExtensionProvider, Akka.Cluster.Tools"]
actor : {
serialize-creators : on
provider : "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
debug : {
receive : on
fsm : on
event-stream : on
router-misconfiguration : on
autoreceive : on
lifecycle : on
unhandled : on
}
}
remote : {
log-received-messages : on
log-sent-messages : on
enabled-transports : [akka.remote.dot-netty.tcp]
dot-netty : {
tcp : {
transport-protocol : tcp
port : 8092
hostname : 10.20.223.45
}
}
log-remote-lifecycle-events : DEBUG
}
cluster : {
log-info : on
seed-nodes : ["akka.tcp://[email protected]:8092"]
debug : {
verbose-heartbeat-logging : off
}
}
}
2017-08-30 07:44:48.2524 Akka.Event.EventStream 7 subscribing [akka://NGOMSCluster/system/deadLetterListener#2069104233] to channel Akka.Event.DeadLetter
2017-08-30 07:44:48.2524 Akka.Event.DeadLetterListener 7 Started (Akka.Event.DeadLetterListener)
2017-08-30 07:44:48.2524 Akka.Event.EventStreamUnsubscriber 7 registering unsubscriber with Akka.Event.EventStream
2017-08-30 07:44:48.2524 Akka.Event.EventStreamUnsubscriber 7 Started (Akka.Event.EventStreamUnsubscriber)
2017-08-30 07:44:48.2524 Akka.Actor.GuardianActor 7 now supervising akka://NGOMSCluster/user/manager
2017-08-30 07:44:48.2524 NGSOMS.ManagerActor 7 Started (NGSOMS.ManagerActor)
2017-08-30 07:44:48.2524 NGSOMS.ManagerActor 7 now supervising akka://NGOMSCluster/user/manager/client
2017-08-30 07:44:48.2524 Akka.Cluster.Tools.Client.ClusterReceptionist 7 Started (Akka.Cluster.Tools.Client.ClusterReceptionist)
2017-08-30 07:44:48.2524 Akka.Event.EventStream 7 subscribing [akka://NGOMSCluster/system/clusterEventBusListener#1987664108] to channel Akka.Cluster.ClusterEvent+IClusterDomainEvent
2017-08-30 07:44:48.2524 Akka.Event.EventStream 7 subscribing [akka://NGOMSCluster/system/remote-watcher#420721983] to channel Akka.Cluster.ClusterEvent+IMemberEvent
2017-08-30 07:44:48.2524 NGSOMS.ClientActor 7 Receive Actor has moved to Ready
2017-08-30 07:44:48.2524 NGSOMS.ClientActor 7 Client Ref is akka://NGOMSCluster/user/manager/client
2017-08-30 07:44:48.2524 NGSOMS.ClientActor 7 Client Actor Starting ...
2017-08-30 07:44:48.2524 NGSOMS.ClientActor 7 Started (NGSOMS.ClientActor)
2017-08-30 07:44:48.2524 NGSOMS.ClientActor 7 now watched by [akka://NGOMSCluster/system/distributedPubSubMediator#796287490]
2017-08-30 07:44:48.2524 Akka.Cluster.ClusterHeartbeatSender 7 Started (Akka.Cluster.ClusterHeartbeatSender)
2017-08-30 07:44:48.2524 Akka.Cluster.ClusterCoreDaemon 7 Node [akka.tcp://[email protected]:8092] is JOINING, roles []
2017-08-30 07:44:48.2804 Akka.Cluster.ClusterCoreDaemon 5 Leader is moving node [akka.tcp://[email protected]:8092] to [Up]
2017-08-30 07:44:48.2814 Akka.Cluster.ClusterCoreDaemon 7 now supervising akka://NGOMSCluster/system/cluster/core/daemon/heartbeatSender
2017-08-30 07:44:48.2814 Akka.Cluster.ClusterCoreDaemon 21 [Initialized] Received Akka.Cluster.InternalClusterAction+Subscribe
2017-08-30 07:44:48.2814 Akka.Cluster.ClusterCoreDaemon 21 [Initialized] Received Akka.Cluster.InternalClusterAction+Subscribe
2017-08-30 07:44:48.2814 Akka.Cluster.ClusterCoreDaemon 21 [Initialized] Received Akka.Cluster.InternalClusterAction+Subscribe
2017-08-30 07:44:48.2814 Akka.Cluster.ClusterCoreDaemon 21 [Initialized] Received Akka.Cluster.InternalClusterAction+Subscribe
2017-08-30 07:44:48.2814 Akka.Event.EventStream 7 subscribing [akka://NGOMSCluster/system/distributedPubSubMediator#796287490] to channel Akka.Cluster.ClusterEvent+IMemberEvent
2017-08-30 07:44:48.2814 Akka.Event.EventStream 7 subscribing [akka://NGOMSCluster/user/manager#1738083469] to channel Akka.Cluster.ClusterEvent+MemberUp
2017-08-30 07:44:48.2814 Akka.Event.EventStream 7 subscribing [akka://NGOMSCluster/system/receptionist#1611611694] to channel Akka.Cluster.ClusterEvent+IMemberEvent
2017-08-30 07:44:48.2814 Akka.Event.EventStream 7 subscribing [akka://NGOMSCluster/system/cluster/core/daemon/heartbeatSender#1833894805] to channel Akka.Cluster.ClusterEvent+IMemberEvent
2017-08-30 07:44:48.2814 Akka.Event.EventStream 7 subscribing [akka://NGOMSCluster/system/cluster/core/daemon/heartbeatSender#1833894805] to channel Akka.Cluster.ClusterEvent+IReachabilityEvent
Server Code - Creating /manager Actor
static void Main(string[] args)
{
var system = ActorSystem.Create("NGOMSCluster");
ActorSystemRefs.ManagerActor = system.ActorOf(Props.Create(() => new ManagerActor()), "manager");
Console.ReadLine();
}
Server Code - Creating /manager/client Actor
class ManagerActor : UntypedActor, IWithUnboundedStash
{
private readonly ILoggingAdapter _log = Logging.GetLogger(Context);
private IActorRef _clientActor;
private IActorRef _exchangeActor;
protected Akka.Cluster.Cluster Cluster = Akka.Cluster.Cluster.Get(Context.System);
protected Dictionary<long, OrderMessage> masterOrderList;
protected Dictionary<long, OrderTrack> orderTracking;
/// <summary>
/// Need to subscribe to cluster changes
/// </summary>
protected override void PreStart()
{
Cluster.Subscribe(Self, new[] { typeof(ClusterEvent.MemberUp) });
//_clientActor = ActorSystemRefs.ClientActor = Context.ActorOf(Props.Create(() => new ClientActor()), "client");
_clientActor = ActorSystemRefs.ClientActor = Context.ActorOf(Props.Create<ClientActor>(), "client");
ClusterClientReceptionist.Get(Context.System).RegisterService(_clientActor);
}
/// <summary>
/// Re-subscribe on restart
/// </summary>
protected override void PostStop()
{
Cluster.Unsubscribe(Self);
}
protected override void OnReceive(object message)
{
if (message is ClusterEvent.MemberUp)
{
_log.Info("Cluster is ready. Able to begin jobs.");
//ready to begin routing messages to back-end
Become(Ready);
Stash.UnstashAll();
}
else
{
Stash.Stash();
}
}
protected void Ready(object message)
{
//Bunch of stuff here for processing messages that come in
}
public IStash Stash { get; set; }
}
Server Code - /manager/client Actor
class ClientActor : ReceiveActor, ILoggingFSM, ILogReceive
{
private readonly ILoggingAdapter _log = Logging.GetLogger(Context);
/// <summary>
/// Need to subscribe to cluster changes
/// </summary>
protected override void PreStart()
{
_log.Info("Client Actor Starting ...");
}
public ClientActor()
{
Ready();
}
private void Ready()
{
_log.Info("Receive Actor has moved to Ready");
_log.Info("Client Ref is " + Context.Self.Path.ToString());
Receive<OrderMessage>(message =>
{
var mes = message as OrderMessage;
//New Order Received
if (mes.State == OrderStates.New)
{
_log.Info("Order " + mes.OrderID.ToString() + " received");
//Send Order Message back to client router with ACK State
Sender.Tell(new OrderMessage(mes.ClientID, mes.OrderID, OrderStates.Acknowledged, mes.Side, mes.Symbol, mes.Price, mes.Quantity));
//send ordermessage manager for processing
ActorSystemRefs.ManagerActor.Tell(mes);
}
if (mes.State == OrderStates.Complete)
{
_log.Info("Order " + mes.OrderID.ToString() + " Completed");
//Send Order Message back to client router to indicate completed with Final Price
Context.ActorSelection("akka.tcp://ClientSystem@localhost:8091/user/ordertracker").Tell(mes);
}
});
Receive<OrderTrack>(message =>
{
//Working Update Received, Should Forward Stats to Client Router
});
}
}
Here is a snip of the wireshark I have running between the two. No packets are seeing until I refresh my RDP Window several seconds after I attempt to send the Message (7:46:24)