Aaronontheweb on 1.4.16
Aaronontheweb on master
Added v1.4.16 placeholder for n… typo (#4734) Allow different versions of MS … and 2 more (compare)
Aaronontheweb on 1.4.16
Aaronontheweb on dev
Added v1.4.16 release notes (#4… (compare)
Hey folks, I have a question about the Simple.Cluster.Transformation sample. I Attempted to set it up such that I have the 'backends' and the frontend running on a second computer (server) , and the client computer is just running a frontend. If I shut down the client, I get some complaints that it is unreachable on the server, but eventually the auto-down-unreachable downs them. If I bring the client back up, everything's back to normal.
However, if I shut the SERVER down, The client can never talk to the server again, even if I bring the server back up... Any ideas as to what I'm doing wrong?
My HOCON looks like this:
akka {
actor {
provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
}
remote {
log-remote-lifecycle-events = DEBUG
helios.tcp {
hostname = "NODE" //CLIENT, or SERVER, depending on where it is run
port = 65530
}
}
cluster {
seed-nodes = [
"akka.tcp://ClusterSystem@SERVER:2551",
"akka.tcp://ClusterSystem@SERVER:2552"]
auto-down-unreachable-after = 2s
}
}
3..ctor(!2, Microsoft.FSharp.Core.FSharpFunc
2<Eventsourced`3<!0,!1,!2>,Microsoft.FSharp.Core.FSharpFunc2<!2,Microsoft.FSharp.Core.FSharpFunc
2<!1,!2>>>, Microsoft.FSharp.Core.FSharpFunc2<Eventsourced
3<!0,!1,!2>,Microsoft.FSharp.Core.FSharpFunc2<!2,Microsoft.FSharp.Core.FSharpFunc
2<!0,Microsoft.FSharp.Core.Unit>>>)'.Guys I am having an issue with with an ask. This is the code making the ask. This code resides in one node:
SupervisorRegistryGetListRequest request = new SupervisorRegistryGetListRequest(Self);
//Make the ask
_SupervisorRegistry.Ask<SupervisorRegistryGetListResponse>(request).ContinueWith<SupervisorRegistryGetListEvent>(taskResponse =>
{
SupervisorRegistryGetListResponse r = taskResponse.Result as SupervisorRegistryGetListResponse;
if (taskResponse.IsFaulted)
{
return new SupervisorRegistryGetListEvent(request, r, false);
}
return new SupervisorRegistryGetListEvent(request, r, true);
}).PipeTo(Self);
and the config is:
akka {
# here we are configuring log levels
log-config-on-start = off
stdout-loglevel = DEBUG
loglevel = DEBUG
// Define an Nlog logger for the Akka system
loggers = ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"]
actor {
provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
}
remote {
log-remote-lifecycle-events = DEBUG
log-received-messages = on
helios.tcp {
transport-class = "Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
applied-adapters = []
transport-protocol = tcp
#will be populated with a dynamic host-name at runtime if left uncommented
#public-hostname = "POPULATE STATIC IP HERE"
hostname = "127.0.0.1"
port = 8777
}
}
}
and this is the code replying to the ask resides on a different node:
Receive<SupervisorRegistryGetListRequest>(r => HandleGetListRequest(r));
... more code here...
private void HandleGetListRequest(SupervisorRegistryGetListRequest r)
{
ImmutableDictionary<MicroServices.Area,IActorRef> immutableDictOfSupervisorsActors =
_KnownSupervisorsActors.ToImmutableDictionary(kvp => kvp.Key, kvp => kvp.Value.SupervisorActorReference);
r.Requestor.Tell(new SupervisorRegistryGetListResponse(r.Requestor,immutableDictOfSupervisorsActors,r));
}
and it's config is:
akka {
# here we are configuring log levels
log-config-on-start = off
stdout-loglevel = DEBUG
loglevel = DEBUG
// Define an Nlog logger for the Akka system
loggers = ["Akka.Logger.NLog.NLogLogger, Akka.Logger.NLog"]
// Enables connectivity to the remote ActorSystemBridge
actor {
provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
debug {
receive = on
autoreceive = on
lifecycle = on
event-stream = on
unhandled = on
}
}
remote {
log-remote-lifecycle-events = DEBUG
helios.tcp {
transport-class = "Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
transport-protocol = tcp
port = 8888
hostname = "127.0.0.1"
}
}
}
The receive is being triggered, however, the message never gets back to the ask. Not sure what's wrong. How can I check what is happening with the reply?
Ask
pattern here - it looks like a book example for publish/subscribe model.@Horusiath do you think FsApi still needs JSON.NET hack or it can be replaced with generic code. In particular I mean replacing the code:
let serializer = context.System.Serialization.FindSerializerForType typeof<'Message> :?> Akka.Serialization.NewtonSoftJsonSerializer
match Serialization.tryDeserializeJObject serializer.Serializer o with
| Some m -> m
| None -> raise (InvalidCastException("Tried to cast JObject to " + typeof<'Message>.ToString()))
with code:
match o with
| :? (byte[]) as bytes ->
let serializer = context.System.Serialization.FindSerializerForType typeof<'Message>
serializer.FromBinary(bytes, typeof<'Message>) :?> 'Message
| _ -> raise (InvalidCastException("Tried to cast object to " + typeof<'Message>.ToString()))