Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 20 17:25
    valdisz synchronize #3889
  • Oct 20 17:17
    valdisz synchronize #3889
  • Oct 20 15:44
    valdisz synchronize #3889
  • Oct 20 09:22
    ismaelhamed commented #3863
  • 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)

Christian Duhard
@cduhard
Context.Become(WaitingForTermination(accounts.Length));
Bartosz Sypytkowski
@Horusiath
yes
but if your have actor based on ReceiverActor or it's persistent version, you won't need much to adjust the sample to work with
Christian Duhard
@cduhard
is there any reason to use this style over Match?
                else if (message is Shutdown)
                {        
            var m = message as Shutdown;
Bartosz Sypytkowski
@Horusiath
no, just convinience
Christian Duhard
@cduhard
i just left some of it from your original sample. I much prefer Match syntax
Bartosz Sypytkowski
@Horusiath
with C# 7 we'll have pattern matching, and all of this will be part of language syntax
Christian Duhard
@cduhard
i was just going to say we need pattern matching
not sure why they didn;t include it in 6
so C# is becoming scala with readable syntax
Bartosz Sypytkowski
@Horusiath
still far from it ;) less expressive type system, no macros etc. also less "magic" ;)
Christian Duhard
@cduhard
i don't like scala syntax
it feels like a mess
Bartosz Sypytkowski
@Horusiath
some parts are nice, some are wtf
like with almost any language
Christian Duhard
@cduhard
the nice things about C# is they've done a pretty good job adding cool language features relatively cleanly
some better shorthand for list manipulation would be nice
they should also alias standard things like map, fold etc
Christian Duhard
@cduhard
This message was deleted
ignore that
Become drrr
to11mtm
@to11mtm
@Horusiath : True, but sometimes guidelines from a library help with Bureaucracy =)
Bartosz Sypytkowski
@Horusiath
@to11mtm true, we wanted to warn people using default serializer, that's why from the next release if you have json.net serializer configured as default, you'll receive warning, that it's going to be obsoleted after v1.5
I feel bad about rellying on default serializer for persistence. Some persistence libs already avoided that, providing their own defaults
to11mtm
@to11mtm
...speaking of... are there any Oracle Persistence libraries out there that anyone is aware of?
Bartosz Sypytkowski
@Horusiath
Christian Duhard
@cduhard
@Horusiath EventStore requires json if you want to use the built in projection framework
Bartosz Sypytkowski
@Horusiath
@cduhard you can always use custom json provider, the one akka uses is quite heavily oriented for akka-specific needs
Christian Duhard
@cduhard
it's a little late for that :)
we've got 100's of millions of events in the eventstore using the current default serializer
Bartosz Sypytkowski
@Horusiath
nice to hear - I don't know it eventstore provider doesn't use its own json configuration thou
Christian Duhard
@cduhard
there isn't a well supported version
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