Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 19 23:39
    valdisz synchronize #3889
  • Oct 19 23:08
    edvinasz commented #2947
  • Oct 19 13:36
    Aaronontheweb commented #3973
  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3995
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump BenchmarkDotNet from 0.10.… (compare)

  • Oct 19 13:34
    dependabot-preview[bot] edited #3995
  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3993
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump Google.Protobuf from 3.9.1… (compare)

  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3991
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump Microsoft.Extensions.Depen… (compare)

  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3989
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump ApiApprover from 3.0.1 to … (compare)

  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3992
  • Oct 19 13:34
    dependabot-preview[bot] edited #3993
  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3985
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump System.Reflection.Emit fro… (compare)

  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3986
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump FsCheck.Xunit from 2.9.0 t… (compare)

  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3983
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump NUnit from 3.6.1 to 3.12.0… (compare)

Christian Duhard
@cduhard
i am sorta maintaining my own version
eventstore doesn't require json. if you want to use the native projection engine (v8) is has to be able to parse your events
i think they mentioned supporting a pluggable serializer at some point. MsgPack or proto-buf would be nice
ilhadad
@ilhadad
I have a receive actor that has both a ReceiveAny and Unhandled method. I am getting in the console log Got unhandled message From:akka://all-system/. Not sure why the message is not delivered.
Yin Zhang
@melcloud
@ilhadad can you provide your code example and akka config?
ilhadad
@ilhadad
sure here it is...
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="couchbaseClients">
      <section name="couchbase" type="Couchbase.Configuration.Client.Providers.CouchbaseClientSection, Couchbase.NetClient" />
    </sectionGroup>
    <section name="akka" type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka" />
  </configSections>

  <startup> 
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
  </startup>

  <akka>
    <hocon>
      <![CDATA[

                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
              }
            }

            cluster {
              seed-nodes = ["akka.tcp://SSAActorSystem@127.0.0.1:4053"]
              #role = ["httpbridge"]

              auto-down-unreachable-after = 30s
            }



        akka.persistence{
                    journal{
                        plugin = "akka.persistence.journal.couchbase"
                        couchbase:{
                            class = "Akka.Persistence.CouchBase.Journal.CouchBaseDbJournal, Akka.Persistence.CouchBase"
                            ServersURI:[
                                "http://127.0.0.1:8091"
                            ],
                            BucketName = "testakka",
                            BucketUseSsl = false,
                            Password = "",
                            DefaultOperationLifespan = 2000,
                            PoolConfiguration.MaxSize = 10,
                            PoolConfiguration.MinSize = 5,
                            SendTimeout = 12000
                        }
                    }

                    snapshot-store{
                        plugin = "akka.persistence.snapshot-store.couchbase"
                        couchbase:{
                            class = "Akka.Persistence.CouchBase.Snapshot.CouchBaseDbSnapshotStore, Akka.Persistence.CouchBase"
                            ServersURI:[
                                "http://127.0.0.1:8091"
                                ],
                                BucketName = "testakka",
                                BucketUseSsl = false,
                                Password = "",
                                DefaultOperationLifespan = 2000,
                                PoolConfiguration.MaxSize = 10,
                                PoolConfiguration.MinSize = 5,
                                SendTimeout = 12000
                            }
                        }
                    }  
                }

            ]]>
    </hocon>
  </akka>

  <couchbaseClients>
    <couchbase useSsl="false">
      <servers>
        <add uri="http://127.0.0.1:8091"></add>
      </servers>
      <buckets>
        <!--<add name="default" useSsl="false" password="" operationLifespan="2000">
                    <connectionPool name="custom" maxSize="10" minSize="5" sendTimeout="12000"></connectionPool>
                </add>-->
        <add name="testakka" useSsl="false" password="" operationLifespan="2000">
          <connectionPool name="custom" maxSize="10" minSize="5" sendTimeout="12000"></connectionPool>
        </add>
      </buckets>
    </couchbase>
  </couchbaseClients>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
To add more color to my help request. The actor in question is residing in the node and not remotely.
Aaron Stannard
@Aaronontheweb
which message showed up in Unhandled?
ilhadad
@ilhadad
It did not call it.
or the receiveany
Aaron Stannard
@Aaronontheweb
can you spell it out for us?
which message, which actor, and when
if it's a big complicated user-defined actor, NBD - but put some meat on the bones
also - which version of Akka.NET? latest stable?
ilhadad
@ilhadad

Latest akka from nuget.
here is the call to the actor...

            SSAActorSystem.ActorReferences.HTTPClientBridge.Tell(new HTTPSourcedCommand(c, Context.User.Identity.Name, Context.ConnectionId), ActorRefs.Nobody);

Here is how i instantiate the actor...

            //Instantiate the HTTPClient BridgeActor
            ActorReferences.HTTPClientBridge = _ActorSystem.ActorOf(
                Props.Create(() => new HTTPClientBridgeActor(_HTTPClientEventPusher, new IActorRef[] { ActorReferences.ClientList })),
                "HTTPClientBridge"
                );

Here is the actor itself...


    public class HTTPClientBridgeActor:ReceiveActor
    {
        private ILoggingAdapter _logger = Context.GetLogger();

        private static string _ActorType = typeof(HTTPClientBridgeActor).Name;


        public HTTPClientBridgeActor(IHTTPClientInterface httpClientEventInterface, IActorRef[] Supervisors) 
        {

            Become(Initializing);
        }

        #region Actor States

        /// <summary>
        /// This method sets the actor so that it can "boot" itself up.
        /// </summary>
        private void Initializing()
        {
            _logger.Debug("Actor {0} is initializing.", _ActorType);

            // This catch all will log if there are any weird unhandled messages.
            Receive<object>(o =>
            {
                _logger.Debug("{1} Got unhandled message From:{0}", Sender.Path.ToStringWithAddress(),_ActorType);
            });

            _logger.Debug("Actor {0} is Initialized, moving to Ready state.", _ActorType);

            Become(Ready);

        }

        /// <summary>
        /// The command processing state sets this actor ready to receive any command from other actors.
        /// </summary>
        private void Ready()
        {
            _logger.Debug("Actor {0} is getting Ready.", _ActorType);

            // Process Commands that are coming from external clients
            Receive<HTTPSourcedCommand>(c => ProcessExternalHTTPClientCommandHandler(c));
            Receive<string>(s=> HandleStringCommand(s));

            // This catch all will log if there are any weird unhandled messages.
            ReceiveAny(o =>
            {
                _logger.Debug("{1} got unhandled message from:{0} Unhandled Message:{1}", Sender.Path.ToStringWithAddress(), o.GetType().Name, _ActorType);
            });


            _logger.Debug("Actor {0} is Ready.", _ActorType);

        }

        #endregion Actor States


        protected override void Unhandled(object message)
        {
            //Do something with the message.
        }
... more code after this
Here is the message that is being sent...
    public class HTTPSourcedCommand
    {
        public HTTPSourcedCommand()
        {

        }

        public HTTPSourcedCommand(string commandType, string area, string id = null, string fieldName = null, object data = null, string user = null)
        {
            CommandType = commandType;
            Data = data;
            Area = area;
            FieldName = fieldName;
            Id = id;
            User = user;
        }

        /// <summary>
        /// Returns a copy of the original command with the user name added.
        /// </summary>
        /// <param name="originalCommand"></param>
        /// <param name="user">user name</param>
        public HTTPSourcedCommand( HTTPSourcedCommand originalCommand,string user,string connectionId)
        {
            CommandType = originalCommand.CommandType;
            Data = originalCommand.Data;
            Area = originalCommand.Area;
            FieldName = originalCommand.FieldName;
            Id = originalCommand.Id;
            User = user;
            ConnectionId = connectionId;
        }


        [JsonProperty]
        public string CommandType { get; private set; }
        [JsonProperty]
        public object Data { get; private set; }
        [JsonProperty]
        public string Area { get; private set; }
        [JsonProperty]
        public string FieldName { get; private set; }
        [JsonProperty]
        public string Id { get; private set; }
        [JsonProperty]
        public string User { get; private set; }
        [JsonProperty]
        public string ConnectionId { get; private set; }

    }
Aaron Stannard
@Aaronontheweb
Become call in the constructor
there's your problem
just call Initializing
we had an issue logged about that somewhere
but in general - don't call Become for behavior #1
only call it when switching from one active behavior to another
there's stuff inside the behavior stack still being initialized when the actor instance is being constructed
ilhadad
@ilhadad
It seemed to call the Initializing method.
Aaron Stannard
@Aaronontheweb
so what behavior is the actor in when the issue occurs?
initializing or ready
ilhadad
@ilhadad
Ready
Initializing is called and then it calls ready.
Aaron Stannard
@Aaronontheweb
we might have fixed the Become in the constructor bug then
and so ReceiveAny misses a message?
ilhadad
@ilhadad
Here's the console output...
2016-04-04 18:10:16.6303|INFO|EY.SSA.ActorSystemBridge.Program|Starting SSA Actor System at HTTP Client Bridge at:CF_IHadad
[DEBUG][4/4/2016 10:10:16 PM][Thread 0008][EventStream] StandardOutLogger started
[INFO][4/4/2016 10:10:16 PM][Thread 0015][[akka://SSAActorSystem/system/log1-NLogLogger]] NLogLogger started
[DEBUG][4/4/2016 10:10:16 PM][Thread 0008][EventStream(SSAActorSystem)] Logger log1-NLogLogger [NLogLogger] started
[DEBUG][4/4/2016 10:10:16 PM][Thread 0008][EventStream(SSAActorSystem)] StandardOutLogger being removed
2016-04-04 18:10:16.9651|INFO|EY.SSA.ActorSystemBridge.Program|Started SSA Actor System at HTTP Client Bridge at:CF_IHadad
2016-04-04 18:10:36.2219|DEBUG|EY.SSA.CommonBusinessLogic.Actors.HTTPClientBridgeActor|Actor HTTPClientBridgeActor is initializing.
2016-04-04 18:10:38.6722|DEBUG|EY.SSA.CommonBusinessLogic.Actors.HTTPClientBridgeActor|Actor HTTPClientBridgeActor is Initialized, moving to Ready state.
2016-04-04 18:10:38.6922|INFO|EY.SSA.ActorSystemBridge.Program|HTTP Server running on http://localhost:8080
2016-04-04 18:10:38.7037|DEBUG|EY.SSA.CommonBusinessLogic.Actors.HTTPClientBridgeActor|Actor HTTPClientBridgeActor is getting Ready.
Enter a command:
2016-04-04 18:10:38.7197|DEBUG|EY.SSA.CommonBusinessLogic.Actors.HTTPClientBridgeActor|Actor HTTPClientBridgeActor is Ready.
2016-04-04 18:10:49.7208|DEBUG|EY.SSA.CommonBusinessLogic.Actors.HTTPClientBridgeActor|HTTPClientBridgeActor Got unhandled message From:akka://all-systems/
2016-04-04 18:10:49.7354|DEBUG|EY.SSA.CommonBusinessLogic.Actors.HTTPClientBridgeActor|HTTPClientBridgeActor Got unhandled message From:akka://all-systems/
Yep. it is as if the actor never received it.
Aaron Stannard
@Aaronontheweb
ok, so it looks like the Receive<object> you set in the `Initialzing state is still there
because that's your own debug message showing up
ilhadad
@ilhadad
Oh yeah
I see that.
wierd.
Aaron Stannard
@Aaronontheweb
I'm wondering if this did something funny to the first behavior
ilhadad
@ilhadad
So should I just call Initializing from the constructor?
just to test?
Aaron Stannard
@Aaronontheweb
like it basically did INITIALIZING + READY --> your behaviuor
give it a try
ilhadad
@ilhadad
ok
Aaron Stannard
@Aaronontheweb
calling Become twice is essentially what's happening here
not sure what our test coverage is for that
ilhadad
@ilhadad
That was it!!!!
It sounds like it preferred the first become over the second one.
It's a good thing I was not consistent in my logging messages :smile:
Thanks so much. We've been scratching our heads for a bit here.
Aaron Stannard
@Aaronontheweb
filed #1849 for you @ilhadad