akka.net | Canonical actor model implementation for .NET with local + | Microservice library

 by   akkadotnet C# Version: 1.5.7 License: Non-SPDX

kandi X-RAY | akka.net Summary

kandi X-RAY | akka.net Summary

akka.net is a C# library typically used in Architecture, Microservice applications. akka.net has no bugs, it has no vulnerabilities and it has medium support. However akka.net has a Non-SPDX License. You can download it from GitHub.

Akka.NET is a professional-grade port of the popular Java/Scala framework Akka distributed actor framework to .NET. Akka.NET is a .NET Foundation project.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              akka.net has a medium active ecosystem.
              It has 4398 star(s) with 1021 fork(s). There are 264 watchers for this library.
              There were 6 major release(s) in the last 12 months.
              There are 355 open issues and 1954 have been closed. On average issues are closed in 362 days. There are 81 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of akka.net is 1.5.7

            kandi-Quality Quality

              akka.net has 0 bugs and 0 code smells.

            kandi-Security Security

              akka.net has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              akka.net code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              akka.net has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              akka.net releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              akka.net saves you 31 person hours of effort in developing the same functionality from scratch.
              It has 285 lines of code, 0 functions and 2090 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of akka.net
            Get all kandi verified functions for this library.

            akka.net Key Features

            No Key Features are available at this moment for akka.net.

            akka.net Examples and Code Snippets

            No Code Snippets are available at this moment for akka.net.

            Community Discussions

            QUESTION

            Handling a received not covered in become
            Asked 2022-Feb-16 at 17:19

            I am using Akka.NET to develop a logistics simulation.

            Having tried various patterns, it seems to me that FSM-type behaviour using become will substantially simplify development.

            The system has a repeating clock tick message that all relevant actors receive in order to simulate accelerated passage of time for the entire simulation system. This clock tick message should be handled by all actors that are subscribed to it regardless of which message loop is currently active for any specific actor.

            Am I correct in thinking that the only way to handle the clock message in all message loops is by explicitly checking for it in all message loops, or is there a way of defining messages that are handled regardless of which message loop is active?

            If the former is the case my idea is to check for a clock tick message in a ReceiveAny, which all the message loops need to have anyway, and to then pass it on to an appropriate handler.

            ...

            ANSWER

            Answered 2022-Feb-16 at 17:19

            You could use Stashing to Stash the messages while Simulating. I came up with the following code sample to better explain how that works:

            Source https://stackoverflow.com/questions/71079733

            QUESTION

            How to select a specific overload of a method?
            Asked 2021-Dec-07 at 00:45

            I'm calling a C# API which uses overloads and optional parameters. Unfortunately, one of the overloads is a params object[] and F# selects it over a more specific overload which I intend to call. How do I make F# select the overload I want?

            Here's a small repro. And here is a link to the actual API.

            ...

            ANSWER

            Answered 2021-Dec-07 at 00:45

            To call the expression version with two arguments, you need:

            Source https://stackoverflow.com/questions/70253567

            QUESTION

            How to create a child actor in akka.net using F#?
            Asked 2021-Oct-09 at 10:06

            I have two actors - childActor and parentActor

            ...

            ANSWER

            Answered 2021-Oct-09 at 10:06

            IActorRefFactory is an interface responsible for determining a parent and in case of Akka.FSharp it's implemented by ActorSystem and Actor<_> as well. So in your case just use:

            Source https://stackoverflow.com/questions/69505237

            QUESTION

            Using Akka.net with IConfiguration
            Asked 2021-Oct-01 at 14:14

            Almost all Akka.net documentation refers to documentation through HOCON in some form. From my understanding, HOCON was made to tackle issues related to XML-based configuration in .NET Framework. Now that everything in JSON-based (starting in .NET Core), I would really want to configure Akka.net through appsettings.json, just like any other service I write in .NET. Some solutions I have found to this approach seem rather hacky by pasting a HOCON string in the appsettings file, or have the HOCON object inline in the source code. It would be very nice to have it within an appsettings since this fits better in how both my team manages configuration, deployment-wise, and modern .NET applications approach configuration.

            Why is Akka.net using HOCON instead of a more abstract interface such as IConfiguration, and how can I best configure it by following best practices in .NET using appsettings.json and IConfiguration?

            ...

            ANSWER

            Answered 2021-Oct-01 at 14:14

            I believe one of the reasons why Akka.net uses HOCON is due to how it is a 1-1 port of Akka (Java), which also heavily relies on HOCON for configuration. For portability it is then the preferred format for configuring the framework. While it is just speculation from my side, it could be a priority thing why there is no support for IConfiguration since the current way of configuration "just works" even though it fits poorly together with how newer .NET applications are written today.

            There are a few ways that the Akka.Configuration.Config can be built from an IConfiguration instance. One way is to take the IConfiguration object, and construct a JSON string from it, then give it to ConfigurationFactory.ParseString which does support parsing JSON. A HOCON representation can then be obtained from the parsed Config instance. In order to correctly parse a JSON object, the generated HOCON string has to parsed again (my guess is because of a bug that makes it interpret JSON and HOCON differently). Make sure the JSON config does not contain any properties such as {"foo.don" : "bar"}, while HOCON supports resolving foo.don - JSON does not. Below is the extension method I put together for parsing a Config from an IConfiguration instance:

            Source https://stackoverflow.com/questions/69256760

            QUESTION

            Akka.net: Should I specify "split brain resolver" configuration for Lighthouse/Seed nodes
            Asked 2021-Sep-17 at 16:36

            I have this application using Akka.net cluster feature. The people who wrote the code have left the company. I am trying to understand the code and we are planning a deployment.

            The cluster has 2 types of nodes

            QueueServicer: supports sharding and only these nodes should participate in sharding.
            LightHouse: They are just seed nodes, nothing else.

            Lighthouse : 2 nodes
            QueueServicer : 3 Nodes

            I see one of the QueueServicer node unable to join the cluster. Both lighthouse nodes are refusing connection. It constantly tries to join and never succeeds. This has been happening for the last 5 days or so and the node is never dying also. Its CPU and memory usage is high. Also It doesn't have any queue processor actors running when filtered search through the log. It takes long hours for Garbage collection etc. I see in the log for this node, the following.

            {"timestamp":"2021-09-08T22:26:59.025Z", "logger":"Akka.Event.DummyClassForStringSources", "message":Tried to associate with unreachable remote address [akka.tcp://myapp@lighthouse-1:7892]. Address is now gated for 5000 ms, all messages to this address will be delivered to dead letters. Reason: [Association failed with akka.tcp://myapp@lighthouse-1:7892] Caused by: [System.AggregateException: One or more errors occurred. (Connection refused akka.tcp://myapp@lighthouse-1:7892) ---> Akka.Remote.Transport.InvalidAssociationException: Connection refused akka.tcp://myapp@lighthouse-1:7892 at Akka.Remote.Transport.DotNetty.TcpTransport.AssociateInternal(Address remoteAddress) at Akka.Remote.Transport.DotNetty.DotNettyTransport.Associate(Address remoteAddress) --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Akka.Remote.Transport.ProtocolStateActor.<>c.b__12_18(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

            {"timestamp":"2021-09-08T22:26:59.025Z", "logger":"Akka.Event.DummyClassForStringSources", "message":Tried to associate with unreachable remote address [akka.tcp://myapp@lighthouse-0:7892]. Address is now gated for 5000 ms, all messages to this address will be delivered to dead letters. Reason: [Association failed with akka.tcp://myapp@lighthouse-0:7892] Caused by: [System.AggregateException: One or more errors occurred. (Connection refused akka.tcp://myapp@lighthouse-0:7892) ---> Akka.Remote.Transport.InvalidAssociationException: Connection refused akka.tcp://myapp@lighthouse-0:7892 at Akka.Remote.Transport.DotNetty.TcpTransport.AssociateInternal(Address remoteAddress) at Akka.Remote.Transport.DotNetty.DotNettyTransport.Associate(Address remoteAddress) --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Akka.Remote.Transport.ProtocolStateActor.<>c.b__12_18(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

            There are other "Now supervising", "Stopping" "Started" logs which I am omitting here.

            Can you please verify if the HCON config is correct for split brain resolver and Sharding?

            I think LightHouse/SeeNodes should not have the sharding configuration specified. I think it is a mistake. I also think, split brain resolver configuration might be wrong in LightHouse/SeedNodes and should not be specified for seed nodes.

            I appreciate your help.

            Here is the HOCON for QueueServicer Trimmed

            akka {
                loggers = ["Akka.Logger.log4net.Log4NetLogger, Akka.Logger.log4net"]
                log-config-on-start = on
                loglevel = "DEBUG"
                actor {
                    provider = cluster
                    serializers {
                        hyperion = "Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion"
                    }
                    serialization-bindings {
                        "System.Object" = hyperion
                    }
                }

            ...

            ANSWER

            Answered 2021-Sep-17 at 16:36

            I meant to reply to this sooner.

            Here is your problem: you're using two different split brain resolver configurations - one for the QueueServicer and one for Lighthouse. Therefore, how your cluster resolves itself is going to be quite different depending upon who is the leader of each half of the cluster.

            I would stick with a simple keep-majority strategy and use it uniformly on all nodes throughout the cluster - we're very likely going to enable this by default in Akka.NET v1.5.

            If you have any questions, please feel free to reach out to us: https://petabridge.com/

            Source https://stackoverflow.com/questions/69110696

            QUESTION

            Simple TCP server with Akka.NET
            Asked 2021-Sep-13 at 10:43

            Hi I'm learning to use Akka.net and what I want to do is, create a simple TCP server that will periodically send data to the tcp connection. (which will then be picked up by a processingjs client and display in the output)

            Not sure what I'm missing here. Could any of you experts shed some light on the issue?

            These are my actors:

            ...

            ANSWER

            Answered 2021-Sep-13 at 10:43

            Your problem is at line:

            Source https://stackoverflow.com/questions/69142141

            QUESTION

            Dynamically subscribe/unsubscribe in TPL Dataflow
            Asked 2021-May-21 at 14:13

            I have a stream of messages and based on some criteria I want each consumer to be able to process some of them in parallel. Each consumer should be able to subscribe and unsubscribe dynamically.

            I have the following input data constraints:

            • Around 500 messages per seconds
            • Around 15000 consumers
            • Around 500 categories
            • In most cases, each consumer is subscribed for 1-3 categories.

            So far this is what I have:

            ...

            ANSWER

            Answered 2021-May-19 at 17:01

            I think that the entity Category is missing from your model, and adding it will improve your model not only conceptually but also performance-wise. Each category can hold a list of the consumers that are subscribed for this category, making it trivial to send a message only to the subscribed consumers.

            For solving the issue of the thread-safety my suggestion is to use immutable collections instead of mutable HashSets or Lists. The immutable collections offer the advantage that they can be updated safely and atomically with low-lock techniques (ImmutableInterlocked.Update method), and can provide at any time a snapshot of their contents that is unaffected by future modifications. If you are asking how it is possible to mutate an immutable collection, the answer is that you are not mutating it, instead you are replacing the reference with a different immutable collection. These structures are implemented in a way that allows high reusability of their internal bits and pieces. For example adding an item in a ImmutableHashSet that already holds 1,000,000 items, does not require the allocation of a new memory block that contains all the old items plus the new one. Only a handful of tiny objects (nodes in the internal binary tree) will be allocated.

            This convenience comes at a price: most operations on immutable collections are at least 10 times slower than the same operations on their mutable counterparts. Most probably this overhead will be negligible in the grand scheme of things, but you may want to profile and measure it yourself, and judge whether it is impactful or not.

            The Category class:

            Source https://stackoverflow.com/questions/67603494

            QUESTION

            Schedule a conditional email message with Akka.Net
            Asked 2021-Apr-23 at 15:40

            I need to implement the following logic - I send a message to the user, and if he doesn't reply, I send it again after 12 hours. I wonder what is the best way to do this? I was thinking about using Akka.NET - after a certain amount of time the actor would check if the user replied to my message and if not, would send it again.

            Is there maybe an easier way? If not, there are some questions for Akka.NET

            • Do you know any good sources where I can see how this library should be used in ASP.NET Core? The documentation is not clear enough for me.
            • Where to keep the actors and the logic associated with them? In a separate project? Where can I create an actorSystem?

            I'm new to this topic, thank you in advance for all the answers.

            ...

            ANSWER

            Answered 2021-Apr-23 at 15:40

            I theory you could just use standard actor system schedule a message order to resend an email after 12h, but this has natural problems with a fact, that if your process will crash, all of its in-memory state will be lost.

            In practice you could use one of two existing plugins, which give you durable schedules:

            • Akka.Persistence.Reminders which works on top of Akka.Persistence, so you can use it on top of any akka.net persistence plugin.
            • Another way is to use Akka.Quartz.Actor which offers dedicated actors on top of Quartz.NET and makes use of Quartz's persistence capabilities.

            Source https://stackoverflow.com/questions/67232184

            QUESTION

            Efficient way to consume messages in parallel in .NET
            Asked 2021-Mar-24 at 09:00

            I have a stream of messages and based on some criteria I want each consumer to be able to process some of them in parallel. Each consumer should be able to subscribe and unsubscribe dynamically.

            A little bit more information about the input:

            • I receive around 500 messages per second
            • I have around 15000 consumers

            So far I have several solutions:

            1. Events.
            ...

            ANSWER

            Answered 2021-Mar-23 at 15:54

            It looks like a good use case for the TPL Dataflow library. It provides an actor-based programming model, but is more light-weight than Akka.NET or Microsoft Orleans. You can just create few built-in dataflow blocks by providing delegates for each consumer and link them together, providing filtering delegates. Each block has its own queue which you can configure. Everything works in-memory.

            Rx.NET is yet another alternative.

            Source https://stackoverflow.com/questions/66732874

            QUESTION

            File path passed to File.ReadAllBytes method are overridden by prepending executing path
            Asked 2021-Mar-23 at 17:04

            File path passed to File.ReadAllBytes methodsare overridden by prepending executing path

            This is console application running as a service using TopShelf in debug.

            ...

            ANSWER

            Answered 2021-Mar-23 at 17:04

            Some non standard characters (not visible) are encoded before you "d:" in your string and that's why you have that behavior. If you rewrite your path manually (with the quotes) it will work.

            In this example "filePathA" is copy-paste of your path and "filePathB" is the one I rewrote.

            filePathA = 51 bytes

            filePathB = 45 bytes

            Source https://stackoverflow.com/questions/66765543

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install akka.net

            .NET Framework Unit Tests. .NET Framework MultiNode Tests. .NET Core (Windows) Unit Tests. .NET Core (Linux) Unit Tests. .NET Core (Windows) MultiNode Tests. .NET Core (Linux) MultiNode Tests.
            If you want to include Akka.NET in your project, you can install it directly from NuGet. To install Akka.NET Distributed Actor Framework, run the following command in the Package Manager Console.

            Support

            If you need help getting started with Akka.NET, there's a number of great community resources online:. If you and your company are interested in getting professional Akka.NET support, you can contact Petabridge for dedicated Akka.NET support.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link