Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Akka.NET v0.7 #479

Merged
merged 2 commits into from
Oct 20, 2014
Merged

Akka.NET v0.7 #479

merged 2 commits into from
Oct 20, 2014

Conversation

Aaronontheweb
Copy link
Member

Here are the release notes - please suggest any changes that need to be included and I'll add them inline. Giving this a day for comments before we publish and push to master...

0.7.0 Oct 16 2014

Major new changes and additions in this release, including some breaking changes...

Akka.Cluster Support (pre-release) - Akka.Cluster is now available on NuGet as a pre-release package (has a -pre suffix) and is available for testing. After installing the the Akka.Cluster module you can add take advantage of clustering via configuration, like so:

akka {
    actor {
      provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
    }

    remote {
      log-remote-lifecycle-events = DEBUG
      helios.tcp {
    hostname = "127.0.0.1"
    port = 0
      }
    }

    cluster {
      seed-nodes = [
    "akka.tcp://[email protected]:2551",
    "akka.tcp://[email protected]:2552"]

      auto-down-unreachable-after = 10s
    }
  }

And then use cluster-enabled routing on individual, named routers:

/myAppRouter {
 router = consistent-hashing-pool
  nr-of-instances = 100
  cluster {
    enabled = on
    max-nr-of-instances-per-node = 3
    allow-local-routees = off
    use-role = backend
  }
}

For more information on how clustering works, please see #400

Breaking Changes: Improved Stashing - The old WithUnboundedStash and WithBoundedStash interfaces have been slightly changed and the CurrentStash property has been renamed to Stash. Any old stashing code can be replaced with the following in order to continue working:

public IStash CurrentStash { get { return Stash; } set { Stash=value; } }

The Stash field is now automatically populated with an appropriate stash during the actor creation process and there is no need to set this field at all yourself.

Breaking Changes: Renamed Logger Namespaces - The namespaces, DLL names, and NuGet packages for all logger add-ons have been changed to Akka.Loggers.Xyz. Please install the latest NuGet package (and uninstall the old ones) and update your Akka HOCON configurations accordingly.

Serilog Support - Akka.NET now has an official (Serilog)[http://serilog.net/] logger that you can install via the Akka.Logger.Serilog package. You can register the serilog logger via your HOCON configuration like this:

 loggers=["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"]

New Feature: Priority Mailbox - The PriorityMailbox allows you to define the priority of messages handled by your actors, and this is done by creating your own subclass of either the UnboundedPriorityMailbox or BoundedPriorityMailbox class and implementing the PriorityGenerator method like so:

public class ReplayMailbox : UnboundedPriorityMailbox
{
    protected override int PriorityGenerator(object message)
    {
        if (message is HttpResponseMessage) return 1;
        if (!(message is LoggedHttpRequest)) return 2;
        return 3;
    }
}

The smaller the return value from the PriorityGenerator, the higher the priority of the message. You can then configure your actors to use this mailbox via configuration, using a fully-qualified name:

replay-mailbox {
 mailbox-type: "TrafficSimulator.PlaybackApp.Actors.ReplayMailbox,TrafficSimulator.PlaybackApp"
}

And from this point onward, any actor can be configured to use this mailbox via Props:

Context.ActorOf(Props.Create<ReplayActor>()
                    .WithRouter(new RoundRobinPool(3))
                    .WithMailbox("replay-mailbox"));

@Aaronontheweb
Copy link
Member Author

Akka v0.7 Compatibility Report

Integrated Akka v0.7 (local build) into one of our production apps that's been running Akka v0.6.4 in production for months now.... Uses custom loggers (SignalR logger) and lots of other stuff that have been affected by this release. Some notes:

  1. Had to take the suggested steps above for fixing a couple of affected FSMs that used WithUnboundedStash in Akka v0.6.4. Took all of two minutes to do and the API is otherwise exactly the same. No issues.
  2. Unhandled messages are now treated as Warning log events, so if you had any custom loggers that subscribed to that topic specifically on the EventStream you can probably remove that code. Otherwise you may see Unhandled messages logged multiple times.
  3. Third party ActorSystemExtension Akka.Monitoring and Akka.Monitoring.NStatsD were totally unaffected by any changes in Akka v0.7 and are running smoothly without any updates.
  4. Remoting performance and stability is solid - no issues. Remote connectivity between an Akka v0.6.4 and Akka v0.7 application was reliable as well.
  5. Akka v0.7 introduces a ton of improvements in how HOCON configuration chaining is done under the hood. TL;DR;, you can now chain as many configurations together as you like using WithFallback without having to worry about any of the default configurations bumping off any user-defined configuration. Our application wasn't able to take advantage of the App/Web.config-based configuration introduced in Akka v0.6.4 due to this bug (we have a block of code where we have to dynamically populate the private EC2 IP into the Akka.Remote configuration at run-time, and this issue prevented us from doing that while preserving our other settings.) I'm happy to report that this is no longer an issue in Akka v0.7.

Over all, despite all of the changes that have been made under the hood there were no expected changes in behavior or performance aside from those made explicit in the release notes. Total time to integrate was less than 10 minutes.

@Aaronontheweb
Copy link
Member Author

I'll do a separate report for some of the Akka.Cluster stuff, since that's brand new and doesn't have any legacy projects sitting on top of it... Will be integrating that into our apps and testing them in our local / dev environments over the coming days. Specifically interested in seeing the cluster adapt to changes in network topology and ensuring that cluster-routing works as expected.

@HCanber
Copy link
Contributor

HCanber commented Oct 17, 2014

Excellent!

Unhandled messages are now treated as Warning log events, so if you had any custom loggers that subscribed to that topic specifically on the EventStream you can probably remove that code. Otherwise you may see Unhandled messages logged multiple times.

That's strange. If anything they should be Debug messages, and that shouldn't be enabled by default. You need to set akka.actor.debug.unhandled=true to turn it on.

@rogeralsing
Copy link
Contributor

👍

And what @HCanber , it is weird that there are Warning events.

@Aaronontheweb
Copy link
Member Author

I might have misread the labels coming off of the unhandled message logs

@HCanber
Copy link
Contributor

HCanber commented Oct 17, 2014

@Aaronontheweb Recheck the unhandled messages logging and make sure it's not your code that generates those. If it's not we need to address that. The only unhandled Warning messages I can think of are Unhandled Events in FSM but that has been like that for months.

Also see #480 regarding marking ActorRef's == and != as obsolete in this release to prepare for future refactoring.

@HCanber
Copy link
Contributor

HCanber commented Oct 17, 2014

Maybe TestKit should be mentioned as well.

There is a "typo" as well: Serilog Support - Akka.NET now has an official (Serilog)[http://serilog.net/]
The square brackets should surrround "Serilog" and parenthesis the uri.

@Aaronontheweb
Copy link
Member Author

Whoops, yes it was just Debug messages - misread the log output from my SignalR logger:

[DEBUG][10/17/2014 12:30:39 PM][Thread 0016][akka://markedup-notifications/user/api/$d] Unhandled message from akka.tcp://966a5471-3d33-4f4e-9575-ae023044e4e7@localhost:63615/user/remoteRouters/$d : MarkedUp.Common.Models.V2.DTOs.SessionEnd

Maybe TestKit should be mentioned as well.

Yes, definitely! What should we say about it?

@HCanber
Copy link
Contributor

HCanber commented Oct 19, 2014

Yes, definitely! What should we say about it?
Oh I don't know. Just that it's released and that it used for writing unit and integration tests, maybe? If the docs were correct we could direct users there for more info, but there is no point doing that at this moment.

@Aaronontheweb
Copy link
Member Author

Ok, took care of that - if #481 is good to go I'll pull that into this release as well and then we should be all set.

Aaronontheweb added a commit that referenced this pull request Oct 20, 2014
@Aaronontheweb Aaronontheweb merged commit e925cb8 into akkadotnet:dev Oct 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants