Today, we’re going to begin introducing the world to the internals of Akka.NET. These are the advanced technical topics and explain what is actually going on “under the hood” to make the magic happen.

We begin our exploration with Akka.Remote.

What Is Akka.remote?

Akka.Remote is one of the most important modules in the entire framework. Akka.Remote is the module which actually enables a big percentage of the awesome feature of Akka.NET, such as:

  • location transparency (not having to care which process—local or remote—an actor lives in)
  • ability to scale out via configuration, instead of code
  • Akka.Cluster and highly-available clustered systems (built on top of Akka.Cluster)
  • ability to remotely deploy actors from one machine to another

In short: understanding Akka.Remote is a powerful tool to have at your disposal for building distributed systems in Akka.NET.

Akka.NET Remote Connections Explained

The most important piece to understand about Akka.Remote is how remote connections work, and what is the topology of actors responsible for managing remote connections.

The Petabridge team (all two of us) just wrapped up a big two weeks. We launched Akka.NET V1.0 and then traveled to Portland to talk about .NET open source software at .NET Fringe.

.NET Fring logo

One of central themes of .NET Fringe is open source communities - and there’s two sides to this coin:

  • How does an open source project successfully attract contributors and make them effective?
  • How does your typical software developer become an OSS contributor?

I’m going to touch on the former topic in a subsequent post, as that appeals to a more niche audience than the latter.

Why Do Open Source?

All OSS contributors start off like any other typical software developer… So let’s start there.

You work in an office and you’re initially really satisfied with what you do. But engineering is as much a creative endeavor as it is a technical one… And your day job doesn’t really scratch your itch entirely.

You really have the languages, frameworks, tools, and design methodologies that you currently use down cold. At least you think you do. So, in your opinion, there’s not a lot of new or exciting stuff happening at your work place.

After enough time passes, you start to feel unsatisfied. Bored. Unfulfilled.

And thus, you choose one of following:

  1. Switch jobs to someplace else and hope the environment is more stimulating; or
  2. Become complacent (the “default” option) and stop being curious about software development; or
  3. Take matters into your own hands and become responsible for your own happiness when it comes to software development.

Open-source frameworks these days, they just grow up so darn fast…

Today marks a major milestone on a long road—466 days since the first commit, to be exact—in bringing the Reactive Model to the CLR.

Akka.NET has officially left -beta and is production-ready with stable C# and F# APIs, on both Mono and Windows!

Akka.NET (repo) is a community-driven port of Typesafe’s Akka project to .NET. Akka is a framework for building powerful concurrent & distributed applications that scale up/out or down on any cloud.

The framework itself handles all thread management, low-level networking, and the utility code and “plumbing” for you. You just focus on the logic and workflow of your application.

Akka.NET has full C# and F# support, on Windows and Mono.

The Reactive Model Comes to .NET

In early 2014, Roger and Aaron teamed up to bring .NET developers the same power and flexibility that Scala/Java developers enjoy on the JVM. They were inspired by Typesafe’s Akka—the most powerful and important distributed computing framework in the world, trusted by Amazon, Twitter, Klout, Walmart, LinkedIn, Apache Spark and many more for doing massively parallel and stateful computing.

What Akka.NET v1.0 represents is the next step in bringing the principles of the Reactive Manifesto to the Common Language Runtime (CLR). The Manifesto is comprised of the following parts:

Reactive Systems are:

  • Responsive: The system responds in a timely manner if at all possible.
  • Resilient: The system stays responsive in the face of failure. This applies not only to highly-available, mission critical systems — any system that is not resilient will be unresponsive after a failure.
  • Elastic: The system stays responsive under varying workload. Reactive Systems can react to changes in the input rate by...

FoundationDB logo

Last week, Wired ran an article called “What Happens When Apple Buys a Company You Depend On?,” which tells the story of how FoundationDB was acquired by Apple and subsequently threw their customers under the bus.

This is a developer’s worst nightmare. The realization of their worst fears when they choose a technology to build on top of.

Imagine yourself in this scenario: you took a chance on a product or open-source project, invested time with your team to learn what it is and how it works, and figured out to use it to further your mission. You counted on it to be reliable, and wanted it to power your systems for years to come.

And then it gets abandoned, discontinued, or re-licensed, and all your work that depends on this technology is lost.

Anyone whose production systems depend on FoundationDB today is going to have to spend real dollars and real hours replatforming off of it. That’s time and money they could be investing into new development, but instead those resources have to be used to recover. That sucks.

How else could this acquisition occurred, assuming that Apple has no interest in continuing work on FoundationDB?

Akka.NET - a C# port of Typesafe's Akka project

Today the Akka.NET project hit a massive milestone and became code complete for version 1.0.

This puts us on track to hit the v1.0 public release within the timeframe that we (the core Akka.NET contributors) committed to back in February.

“Code Complete?”

This means that every major feature and every public API has been completed and finalized in preparation for release.

1.0 is the release in which we’re going to shed Akka.NET’s -beta tag and commit to preserving these APIs long-term, so this is a major deal. More than a year’s worth of production usage, discussion, and designs have gone into these APIs.

A lot of carefully considered choices and designs go into each Akka.NET release, but this is the most important one we’ve ever done.

Here’s what will be included in the stable release of Akka.NET v1.0, for both Mono and Windows:

  • Akka.NET Core
  • Akka.FSharp
  • Akka.Remote
  • Akka.TestKit
  • Akka.DI (dependency injection)
  • Akka.Loggers (logging)

We will be committing to the v1.0 APIs for long-term, production use.

Can I Still Contribute to 1.0?

Yes! You can! We’re no longer accepting public API modifications or additions, but here are some areas where we’re still actively accepting and encouraging contributions:

  1. Bug fixes;
  2. Spec verification;
  3. Enhancements (don’t affect the public API);
  4. Documentation;
  5. And work on modules that aren’t shipping as part of V1.0, such as Akka.Cluster and Akka.Persistence.

If you want to start contributing to Akka.NET, join us in the Akka.NET Gitter chat. We’re a friendly bunch!

Timeline For V1.0 Release

We still have some work we do before we release the v1.0 bits - mostly documentation...

Today we’re going to learn about one of the really cool things actors can do: change their behavior at run-time!

This capability allows you to do all sorts of cool stuff, like build Finite State Machines (FSM) or change how your actors handle messages based on other messages they’ve received.

Today, we’re going to cover how to make a basic FSM using switchable behavior. We’ll go over advanced FSM approaches in a future post.

Let’s start with a real-world scenario in which you’d want the ability to change an actor’s behavior.

Real-world Scenario: Authentication

Imagine you’re building a simple chat system using Akka.NET actors, and here’s what your UserActor looks like - this is the actor that is responsible for all communication to and from a specific human user.

public class UserActor : ReceiveActor { private readonly string _userId; private readonly string _chatRoomId; public UserActor(string userId, string chatRoomId) { _userId = userId; _chatRoomId = chatRoomId; Receive<IncomingMessage>(inc => inc.ChatRoomId == _chatRoomId, inc => { // print message for user }); Receive<OutgoingMessage>(inc => inc.ChatRoomId == _chatRoomId, inc => { // send message to chatroom }); } } 

So we have basic chat working - yay! But… right now there’s nothing to guarantee that this user is who they say they are. This system needs some authentication.

How...

Now that Akka.NET is leaving beta and hitting the 1.0 milestone, we’ve seen interest and production usage ramp up quickly.

The Last Few Months

Over the last two months, we’ve been working with several cutting-edge teams to help them rearchitect and build out new systems for use cases as diverse as citywide Internet of Things (IoT) monitoring, rearchitecting to microservices, and converting their ETL pipelines from batch to realtime.

Oh, and we’ve been teaching a lot of people the actor model and how to use Akka.NET through our Akka.NET Bootcamp and on-site training.

During that time, we got a little busy and forgot to announce this, so let’s fix that: Petabridge is now officially available for consulting, training, and support!

How We Can Help You

Consulting

Get your Akka.NET projects out the door faster by getting some help from the people who work on it.

Whether you’re looking to rearchitect your system to use microservices, migrate from hacky batch processing to responsive + streaming ETL, or you want to build out scalable new capabilities from scratch, we can help you get there faster. We also have a special offering for combining Akka.NET with Cassandra.

In-person Training

Want to learn how Akka.Cluster and Akka.Persistence can help you build high availability systems easily? And how to integrate them with other technologies your company currently uses like ASP.NET, SignalR, NServiceBus, or Windows Azure?

Well, we do that!

Support

Get fast resolutions to your issues with Akka.NET applications from members of the core engineering team.

In short, we can help you create the new system you’ve envisioned, train your team, and/or help you through whatever bugs come up in your system, saving you tens of thousands of dollars and hundreds of hours of aggravation.

Let’s...

Over the last several months, interest in Akka.NET has increased dramatically. And yet, many people find the actor model intimidating and can’t seem to really get up and running. Developers want to learn how to use Akka.NET, but where do they go? There haven’t been very many good answers to that question. Until now.

We decided to fix that.

And so…

Introducing Akka.net Bootcamp

I’m pleased to announce that we’ve launched Akka.NET Bootcamp to provide this exact learning resource to developers everywhere!

Akka.NET Bootcamp

We put bootcamp together to help you learn the insanely powerful actor model in an accessible, fun way. The course starts from fundamentals and takes you all the way to knowing what you need to in order to create sophisticated, distributed apps in .NET.

What Is Bootcamp?

Bootcamp is a free, self-directed learning course. You can do it at whatever pace you wish. Bootcamp launched initially in C# only, but F# support is almost done. Hundreds of developers around the world are already members of Bootcamp.

Why Should I Do Bootcamp?

You know that you need to get ahead of the curve and learn about distributed computing, functional programming, and cloud computing. When we started learning about distributed computing, we were overwhelmed by the sheer amount of things we needed to know. Consistent hashing, consensus algorithms, PAXOS, Raft, replication strategies… the list goes on and on.

After over a year of hard work, we’re thrilled to announce that Akka.NET will soon be leaving beta! The community of global contributors has grown rapidly and is picking up even more momentum.

Akka.NET (repo) is a community-driven port of JVM Akka to .NET. Akka.NET is a programming framework, based on the Actor Model, for building powerful concurrent & distributed applications more easily.

The framework itself handles all thread management, low-level networking, and the utility code and “plumbing” for you. You just focus on the logic and workflow of your application.

After releasing v0.8 last week, the core contributors met to lay out the roadmap to v1.0 and decide which features will be finalized for the release, and which will remain in beta.

The general focus for the release is a lot of polishing and testing, along with some feature improvements.

When Will 1.0 Come Out?

With some room for error built in, we expect to have 1.0 live in the next 1-2 months.

What’s in 1.0?

Scheduler API Rework

Håkan is leading the charge on redoing the Scheduler API. To revisit, this is the ability to schedule future and/or recurring tasks within your actor system.

Supervisor Strategy Serialization

Roger is already well-underway on reworking how Supervisor strategies are serialized. This will help us ensure that remote hierarchies work as intended when using Akka.Remote and Akka.Cluster.

Specs & Added Stability

The test suite is already thorough, but Bartosz is leading the charge on adding more tests, general polishing, and digging through APIs just to make sure.

Documentation Rework and Cleanup

Andrew is working with a number of community members to rework the documentation, especially the onboarding process for new users to...

NOTE: These are the official release notes from https://github.com/akkadotnet/akka.net/releases/tag/v0.8, but with some slight formatting changes.

Dependency Injection Support For Ninject, Castle Windsor, and Autofac

Thanks to some amazing effort from individual contributor (@jcwrequests), Akka.NET now has direct dependency injection support for Ninject, Castle Windsor, and AutoFac.

Let’s dive in!