Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 21:02
    Aaronontheweb synchronize #3975
  • 21:02
    Aaronontheweb opened #3975
  • 20:11
    IgorFedchenko commented #3973
  • 20:10
    IgorFedchenko synchronize #3973
  • 20:06
    IgorFedchenko synchronize #3973
  • 20:06
    IgorFedchenko synchronize #3973
  • 19:42
    IgorFedchenko edited #3973
  • 18:08
    Aaronontheweb commented #3937
  • 17:27
    Aaronontheweb commented #90
  • 17:26
    Aaronontheweb commented #90
  • 17:25
    Aaronontheweb assigned #90
  • 17:16

    Aaronontheweb on dev

    Provide static GetRoutees.Insta… (compare)

  • 17:16
    Aaronontheweb closed #3974
  • 17:16
    Aaronontheweb milestoned #3974
  • 16:05
    jackowild opened #90
  • 15:08
    Aaronontheweb commented #3974
  • 15:08
    Aaronontheweb commented #3974
  • Oct 13 14:40
    cptjazz synchronize #3974
  • Oct 13 14:07
    cptjazz opened #3974
  • Oct 13 08:30
    ismaelhamed commented #3937
Kamil Wojciechowski
@aph5nt
I have also tried with 'normal' functions declarations ( eg. let execute mailbox state command = () )
did anyone have the same problem ???
Bartosz Sypytkowski
@Horusiath
@aph5nt this sounds like some versioning problem on the F# side (like most of the F# MissingMethodException do)
Kamil Wojciechowski
@aph5nt
@Horusiath runtime is set to 4.4.0.0 and im targeting framework 4.5.2 + referenced fsharp.core from packages (instead of program files)
ok, i will create new standalone console proj
and check it again
to11mtm
@to11mtm
@Horusiath Is there a way to attempt to 're-join' without restarting the entire actorsystem?
Bartosz Sypytkowski
@Horusiath
you need to know the list of nodes, that will be used to join/create the cluster
Kamil Wojciechowski
@aph5nt
@Horusiath ok, in f# console app it works
Bartosz Sypytkowski
@Horusiath
one of the common patterns is to have at least single node that is serves only as connection endpoint with well known address. It doesn't need to perform any work out there, it just needs to be present (see lighthouse project)
to11mtm
@to11mtm
@Horusiath : I will give that a try. As I'm learning the clustering pieces and moving forward, I'm continually reminded of your blog post comment about monads =)
to11mtm
@to11mtm
@Horusiath : THANK YOU! Lighthouse as the middleman does the trick like a charm
Kamil Wojciechowski
@aph5nt
@Horusiath it was R# issue :(
ilhadad
@ilhadad

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?

ilhadad
@ilhadad
One more additional piece of info. The following code defines the _SupervisorRegistry IActorRef:
                        _ActorSystem.ActorSelection("akka.tcp://" + SSAActorSystem.ActorSystemName + "@127.0.0.1:8888/user/SupervisorRegistry")
                            .ResolveOne(TimeSpan.FromSeconds(3))
                            .Result;
Bartosz Sypytkowski
@Horusiath
@ilhadad
  1. If the message has been send but not received, you should be able to see it in DeadLetters.
  2. In the config you've specified, you're using cluster actor ref provider, but there is no cluster seed nodes section specified.
  3. I don't get, why are you using Ask pattern here - it looks like a book example for publish/subscribe model.
Vagif Abilov
@object

@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()))
I replaced such JSON.NET-specific code with more generic and my persistent actors work. But I wonder if I missed some special case.
Bartosz Sypytkowski
@Horusiath
push the PR, I'll review it later today
Vagif Abilov
@object
OK
Bartosz Sypytkowski
@Horusiath
it will be easier to spot the possible problems this way
Vagif Abilov
@object
Sure, will push it ASAP.
Jari Pennanen
@Ciantic
Is the typed actors structurally typed? I mean I can just define my dummy class in another app without referencing some single source of types?
Zetanova
@Zetanova
@Ciantic The akka asm's need to be linked and the base classes used.
Jari Pennanen
@Ciantic
okay, so they need single source of types
Zetanova
@Zetanova
The typed actor is utializing the named methods by reflection for message handling
Jari Pennanen
@Ciantic
I imagine some structurally typed listener would be useful, one wouldn't need to agree on anything but the fields and the connection string
Zetanova
@Zetanova
but i think u can easly make an actorbase type that will use an unlinked type to handle messages
i think the feature to handle messages by reflection is now in some kind of helper class
Jari Pennanen
@Ciantic
I would like to ideally define just interfaces in the listening part
no classes at all
and no assembly linking
Zetanova
@Zetanova
its not importend what it is, the idea is myInstanceActor.Handle((dynamic)message)
one sec
protected override sealed bool Receive(object message)
        {
            MethodInfo method = GetType().GetMethod("Handle", new[] {message.GetType()});
            if (method == null)
            {
                return false;
            }

            method.Invoke(this, new[] {message});
            return true;
        }
its the current code for typedActor
GetType().GetMethod() is i think pritty slow and Handle((dynamic)message) with trycatch would be much faster
but never the less
Jari Pennanen
@Ciantic
public interface Greet {
int Id { get; set; }
string Name { get; set; }
}
ReceiveStructure<IGreet>(greet => Console.WriteLine("Hello {0}", greet.Name));
Zetanova
@Zetanova
if u make an own actor base
that just looks up on the bases interface or class instance
for the handler method
and calls it
ten you have your decopling
Jari Pennanen
@Ciantic
hmm
Zetanova
@Zetanova
of course Context is somethign u will need
Jari Pennanen
@Ciantic
shouldn't it check the type?
Zetanova
@Zetanova
and IActorRef
Jari Pennanen
@Ciantic
I mean the fields
not the type name, which might not be available