Tag Archives: Akka 2.0

[repost ]Introducing Akka 2.0

original:http://blog.typesafe.com/introducing-akka-20-2756

Today we’re thrilled to announce the general availability of the Akka 2.0 open source project, which is at the heart of the Typesafe Stack 2.0.

Akka is a modern event-driven middleware framework, for building high performance and reliable distributed applications in Java and Scala. Akka decouples business logic from low-level mechanisms such as threads and locks. Your Scala or Java program logic lives in lightweight actor objects which send and receive messages. With Akka, you can easily configure how actors are created, destroyed, scheduled, and restarted upon failure.

What does it mean to you? By building with Akka, you gain the ability to reliably scale your application to efficiently run on modern multicore hardware, and to span multiple nodes in a datacenter or cloud service provider, without constantly needing to reinvent the wheel.

Akka 2.0 represents a major update to the Akka 1.x series of releases. The stats are impressive: 700 tickets closed and 1,020 files changed with 98,683 insertion and 57,415 deletions, and over 300 pages of reference documentation. While many of the key concepts in 2.0 will be familiar to Akka 1.x developers, there there are quite a few changes under the hood. So we’ve provided a migration kit to ease the transition (more on this below).

We’ve already highlighted some of the new notable features when we announced the Akka 2.0 pre-release milestones. In this post, we’ll give a broader overview of what’s in the Akka 2.0 final release.

APIs for both Scala and Java

We at Typesafe of course love Scala, but being able to effectively use our frameworks from Java (or in fact from any other JVM language) is critical for us. That’s why with Akka 2.0, we continue to provide two, equally polished sets of APIs: one for Scala and one for Java developers. That means you can have access to all the functionality in Akka without writing a single line of Scala code.

Actor Systems

One of the new building blocks of akka applications is the Actor System. You can think of actor systems as standalone containers that allow users to manage the behavior, structure, life-cycle, configuration, logging of certain actors separately from each other. Actor systems make it easier to structure and manage your application.

Supervision and Death Watch

Two key aspects that can be configured in actor systems are actor supervision and monitoring (the chillingly-named Death Watch).

Supervision describes a dependency relationship between actors, where the supervisor delegates tasks to subordinates while managing their failures. Monitoring, on the other hand, is used to tie one actor to another so that it may react to the other actor’s termination, in contrast to supervision which reacts to failure.

While supervision was available in a limited form in earlier versions of Akka, in 2.0 we have introduced:

  • automatically enforced parental supervision, which means that actors can only be created by other actors—where the top-level actor is provided by the library—and each created actor is supervised by its parent. This restriction makes the formation of actor supervision hierarchies explicit and encourages sound design decisions.
  • a new DSL for managing failure, which makes it simple to define what happens when something goes wrong

 

 

You can configure all sorts of aspects of a failure now.

Paths and Addresses

But how can you distinguish between the various actors managed by a supervisor? That’s where actor paths and addresses come in. Since actors are created in a strictly hierarchical fashion, there must exist a unique sequence of actor names that help the supervisor to identify actors. One way to envision the aforementioned unique sequence is to think about a file system. Indeed, that was the reason why Akka adopted the name “path” to refer to it. You can also query for, retrieve and send messages to an ActorSelection consisting of a group of actors.

 

 

Location Transparency

With every actor identified by a URI—with remote protocol, host, port and path—it becomes very easy to refer to actors across node boundaries, essentially removing the formal distinction between local and remote actors. The implementation of actor supervision has been simplified so that it works the same whether parent and child are on the same or different nodes. And since this distributed approach lends itself so well to scaling out, we made it even easier by allowing the deployment of actors to be specified purely by configuration, instead of through APIs as was the case in Akka 1.x. This means you can adjust the topology of your application at deployment time, without modifying the source code itself.

Configuring two nodes for actor with path /serviceA/aggregation, routed round robin with 10 instances.

 

Event Bus

With Akka 2.0, we’ve also made it easier to send messages to groups of actors. The new Event Bus feature brings a set of composable traits which should help you to build event driven, publish/subscribe style systems much more easily than before.

Improvements to Akka Futures

This leads us to the changes around akka.dispatch.Future. With Akka 2.0, Futures are decoupled from their ExecutionContextTimeout management and Actor.ask functionality. This is great news since these changes not only make akka.dispatch.Future more adherent to the the Single Responsibility Principle, but also allow much more flexibility when it comes to designing non-blocking concurrent computations with actors and futures.  It’s also worth mentioning that Akka 2.0 is using the upcoming Scala 2.10 standard library Future implementation, which is a joint effort between the EPFL Scala team and the Akka team. Look out for scala.concurrent.future!

Much Improved Performance and Scalability

Akka 2.0 now uses a new Fork/Join executor (developed by Doug Lea) to improve message passing throughput and scalability. Our benchmarks show that on multi-core machines the improvements can be as high as 10X compared to java.util.concurrent.ThreadPoolExecutor.

Migration Kit

Finally, the new version of Akka comes with a migration kit that should make it easier for 1.x users to migrate in small, incremental steps (you can learn about this feature here).

Of course these are just the highlights; there are many other changes and improvements, like the redesigned Routers and Dispatchers, for example. We hope this short introduction got you excited enough about Akka 2.0 to dig in and discover the rest!

You can find out more about Akka 2.0 by browsing the extensive and newly expanded documentation on the Akka project site. The open source release is available for download at the freshly redesignedAkka project site.

Of course, Akka 2.0 will also plays a central role in the commercially supported Typesafe Stack 2.0.

Happy hAkking!

While you’re here, don’t miss our other recent posts introducing the Typesafe Stack 2.0, Play 2.0, and the Typesafe Console.

Introducing Typesafe Stack 2.0

original:http://blog.typesafe.com/introducing-typesafe-stack-20

Today is a big day for Typesafe, as we announce the availability of Typesafe Stack 2.0, including Play 2.0 and Akka 2.0, and the availability of the Typesafe Console as part of the commercialTypesafe Subscription.

The Typesafe Stack is a comprehensive platform for building applications in Java and Scala that can scale to the largest workloads in cloud computing and virtualized datacenter environments. The Typesafe Stack includes the Scala programming language, Akka event-driven middleware, and now the Play web framework, along with a robust suite of development tools.

Since we have a lot to talk about today, we’ve broken the news up into a few different blog posts. Here, we provide the highlights with links for you to dig deeper.

We’ve also posted a new whitepaper on our web site that goes into more depth on the Typesafe Stack 2.0, and why it’s relevant to today’s professional software developers.

Play 2.0

We announced in November that Play framework, the highly productive web framework for Scala and Java, would become part of the Typesafe Stack. Now, just a few months later, we are happy to announce that Play 2.0 has arrived and is part of the open source Typesafe Stack 2.0 and the commercial Typesafe Subscription.

Play framework 2.0 continues the emphasis on web developer productivity that has always separated Play from the pack. Version 2.0 takes the framework to a new level, with a stable and scalable foundation based on Scala and Akka, and a reactive model based on event-driven, non-blocking IO. All with native support for both Java and Scala applications.

Learn more about Play 2.0 in our blog post: Introducing Play 2.0

Akka 2.0

Just last week we announced the open source release of Akka 2.0, the event-driven middleware framework for building high performance, reliable, and distributed applications in Java and Scala. Now, it’s available as part of the Typesafe Stack and the commercial Typesafe Subscription as well.

Akka 2.0 simplifies the creation of distributed applications that span many nodes in a cloud computing or virtualized datacenter environment, with new features including location transparency, configuration-based deployment, supervision and life-cycle monitoring, and dramatic performance and scalability improvements.

Learn more about Akka 2.0 in our blog post: Introducing Akka 2.0

Typesafe Console

Monitoring distributed event-driven systems at scale can be a challenge. That’s why we’re excited to introduce the Typesafe Console, an enterprise-grade dashboard for monitoring applications built on the Typesafe Stack. The Typesafe Console is exclusively available to Typesafe Subscription customers.

The Typesafe Console provides insight into usage trends and performance characteristics of event-driven Akka actor based systems. It enables your staff to optimize system performance and detect bottlenecks before they become a problem.

Learn more about the Typesafe Console in our blog post: Introducing Typesafe Console

Scala IDE for Eclipse 2.0

Great platforms require great developer tools.  That’s why we’re delighted to have recently released the Scala IDE for Eclipse 2.0, which provides advanced editing and debugging support for the development of pure Scala and mixed Scala-Java applications.

Learn more about the IDE in our blog post: Scala IDE for Eclipse 2.0

Typesafe Subscription and Services

The Typesafe Subscription provides commercial support, maintenance, and deployment tools for the open source Typesafe Stack. With this release, the Typesafe Subscription covers the Play web framework in addition to Scala and Akka, and adds the Typesafe Console for monitoring Typesafe Stack applications. Typesafe also provides training and consulting for Scala, Akka, and now the Play web framework.

Learn more about commercial services on our web site: Typesafe Products and Services

Putting It To Work

Great technology is meaningless unless it can be productively applied. That’s why we’re so excited to be working with organizations ranging from the smallest startups to the largest global financial institutions who are adopting the technology in the Typesafe Stack. A case in point is Klout, the fast growing startup that measures influence online. Felipe Oliveira, Lead Application Services Engineer at Klout, makes the case for our stack well:

We were able to scale to billions of API transactions with a very small team with the extensive use of Play and Akka. Scala has also been a powerful development platform for Klout, offering greater scalability and efficiency than our previous platform.

Learn more about how Klout is using Play framework and the Typesafe Stack in this post on the Official Klout Blog.

Download the Typesafe Stack today, and get started taking your own business to the next level. We’ll be there to support you every step of the way.