2011-04-09 19:55:46 -06:00
|
|
|
Getting Started
|
|
|
|
|
===============
|
|
|
|
|
|
2011-05-08 10:23:05 +02:00
|
|
|
Prerequisites
|
|
|
|
|
-------------
|
|
|
|
|
|
2011-05-10 15:54:25 +02:00
|
|
|
Akka requires that you have `Java 1.6 <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_ or
|
2011-05-08 10:23:05 +02:00
|
|
|
later installed on you machine.
|
|
|
|
|
|
2012-05-11 10:30:43 +02:00
|
|
|
Getting Started Guides and Template Projects
|
|
|
|
|
--------------------------------------------
|
|
|
|
|
|
|
|
|
|
The best way to start learning Akka is to download the Typesafe Stack and either try out
|
|
|
|
|
the Akka Getting Started Tutorials or check out one of Akka Template Projects. Both comes
|
|
|
|
|
in several flavours depending on your development environment preferences.
|
|
|
|
|
|
|
|
|
|
- `Download Typesafe Stack <http://typesafe.com/resources/getting-started/typesafe-stack/downloading-installing.html>`_
|
|
|
|
|
- `Getting Started Tutorials <http://typesafe.com/resources/getting-started/tutorials/index.html>`_
|
|
|
|
|
- `Template Projects <http://typesafe.com/resources/getting-started/typesafe-stack/downloading-installing.html#template-projects-for-scala-akka-and-play>`_
|
|
|
|
|
|
2011-05-08 10:23:05 +02:00
|
|
|
Download
|
|
|
|
|
--------
|
|
|
|
|
|
2012-05-11 10:30:43 +02:00
|
|
|
There are several ways to download Akka. You can download it as part of the Typesafe Stack
|
|
|
|
|
(as described above). You can download the full distribution with microkernel, which includes
|
|
|
|
|
all modules. Or you can use a build tool like Maven or SBT to download dependencies from the
|
|
|
|
|
Akka Maven repository.
|
2011-05-08 10:23:05 +02:00
|
|
|
|
|
|
|
|
Modules
|
|
|
|
|
-------
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-05-26 17:14:42 +12:00
|
|
|
Akka is very modular and has many JARs for containing different features.
|
|
|
|
|
|
2012-05-11 10:30:43 +02:00
|
|
|
- ``akka-actor-2.1-SNAPSHOT.jar`` -- Classic Actors, Typed Actors, IO Actor etc. Has ZERO dependencies.
|
2012-03-05 10:50:54 +13:00
|
|
|
- ``akka-remote-2.1-SNAPSHOT.jar`` -- Remote Actors
|
2012-05-11 10:30:43 +02:00
|
|
|
- ``akka-testkit-2.1-SNAPSHOT.jar`` -- Toolkit for testing Actor systems
|
2012-03-05 10:50:54 +13:00
|
|
|
- ``akka-kernel-2.1-SNAPSHOT.jar`` -- Akka microkernel for running a bare-bones mini application server
|
2012-05-11 10:30:43 +02:00
|
|
|
- ``akka-transactor-2.1-SNAPSHOT.jar`` -- Transactors - transactional actors, integrated with Scala STM
|
|
|
|
|
- ``akka-agent-2.1-SNAPSHOT.jar`` -- Agents, integrated with Scala STM
|
|
|
|
|
- ``akka-camel-2.1-SNAPSHOT.jar`` -- Apache Camel integration
|
|
|
|
|
- ``akka-zeromq-2.1-SNAPSHOT.jar`` -- ZeroMQ integration
|
|
|
|
|
- ``akka-slf4j-2.1-SNAPSHOT.jar`` -- SLF4J Event Handler Listener
|
2012-03-05 10:50:54 +13:00
|
|
|
- ``akka-<storage-system>-mailbox-2.1-SNAPSHOT.jar`` -- Akka durable mailboxes
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-10-05 17:41:00 +02:00
|
|
|
How to see the JARs dependencies of each Akka module is described in the
|
|
|
|
|
:ref:`dependencies` section. Worth noting is that ``akka-actor`` has zero
|
|
|
|
|
external dependencies (apart from the ``scala-library.jar`` JAR).
|
2011-05-08 10:23:05 +02:00
|
|
|
|
|
|
|
|
Using a release distribution
|
|
|
|
|
----------------------------
|
|
|
|
|
|
2011-12-16 12:12:03 +13:00
|
|
|
Download the release you need from http://akka.io/downloads and unzip it.
|
2011-10-05 17:41:00 +02:00
|
|
|
|
|
|
|
|
Using a snapshot version
|
|
|
|
|
------------------------
|
|
|
|
|
|
2012-03-08 16:33:47 +13:00
|
|
|
The Akka nightly snapshots are published to http://repo.akka.io/snapshots/ and are
|
2011-12-15 15:39:30 +13:00
|
|
|
versioned with both ``SNAPSHOT`` and timestamps. You can choose a timestamped
|
|
|
|
|
version to work with and can decide when to update to a newer version. The Akka
|
|
|
|
|
snapshots repository is also proxied through http://repo.typesafe.com/typesafe/snapshots/
|
|
|
|
|
which includes proxies for several other repositories that Akka modules depend on.
|
2011-04-09 19:55:46 -06:00
|
|
|
|
|
|
|
|
Microkernel
|
2011-12-15 15:39:30 +13:00
|
|
|
-----------
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-12-15 15:39:30 +13:00
|
|
|
The Akka distribution includes the microkernel. To run the microkernel put your
|
|
|
|
|
application jar in the ``deploy`` directory and use the scripts in the ``bin``
|
|
|
|
|
directory.
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-05-26 17:14:42 +12:00
|
|
|
More information is available in the documentation of the :ref:`microkernel`.
|
2011-04-09 19:55:46 -06:00
|
|
|
|
|
|
|
|
Using a build tool
|
2011-04-11 21:26:13 -06:00
|
|
|
------------------
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-10-05 17:41:00 +02:00
|
|
|
Akka can be used with build tools that support Maven repositories. The Akka
|
2012-03-08 16:33:47 +13:00
|
|
|
Maven repository can be found at http://repo.akka.io/releases/ and Typesafe provides
|
2011-10-05 17:41:00 +02:00
|
|
|
http://repo.typesafe.com/typesafe/releases/ that proxies several other
|
|
|
|
|
repositories, including akka.io.
|
2011-04-09 19:55:46 -06:00
|
|
|
|
|
|
|
|
Using Akka with Maven
|
2011-05-08 10:23:05 +02:00
|
|
|
---------------------
|
|
|
|
|
|
2012-05-11 10:30:43 +02:00
|
|
|
The simplest way to get started with Akka and Maven is to check out the
|
|
|
|
|
`Akka/Maven template <http://typesafe.com/resources/getting-started/typesafe-stack/downloading-installing.html#template-projects-for-scala-akka-and-play>`_
|
|
|
|
|
project.
|
2011-05-08 10:23:05 +02:00
|
|
|
|
|
|
|
|
Summary of the essential parts for using Akka with Maven:
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-05-08 10:23:05 +02:00
|
|
|
1) Add this repository to your ``pom.xml``:
|
2011-04-09 19:55:46 -06:00
|
|
|
|
|
|
|
|
.. code-block:: xml
|
|
|
|
|
|
|
|
|
|
<repository>
|
2011-08-26 17:25:18 +02:00
|
|
|
<id>typesafe</id>
|
|
|
|
|
<name>Typesafe Repository</name>
|
|
|
|
|
<url>http://repo.typesafe.com/typesafe/releases/</url>
|
2011-04-09 19:55:46 -06:00
|
|
|
</repository>
|
|
|
|
|
|
2012-03-05 10:50:54 +13:00
|
|
|
2) Add the Akka dependencies. For example, here is the dependency for Akka Actor 2.1-SNAPSHOT:
|
2011-04-09 19:55:46 -06:00
|
|
|
|
|
|
|
|
.. code-block:: xml
|
|
|
|
|
|
|
|
|
|
<dependency>
|
2011-11-18 13:17:57 +01:00
|
|
|
<groupId>com.typesafe.akka</groupId>
|
2011-04-09 19:55:46 -06:00
|
|
|
<artifactId>akka-actor</artifactId>
|
2012-03-05 10:50:54 +13:00
|
|
|
<version>2.1-SNAPSHOT</version>
|
2011-04-09 19:55:46 -06:00
|
|
|
</dependency>
|
|
|
|
|
|
2011-12-15 15:39:30 +13:00
|
|
|
**Note**: for snapshot versions both ``SNAPSHOT`` and timestamped versions are published.
|
2011-05-08 10:23:05 +02:00
|
|
|
|
|
|
|
|
|
2011-04-09 19:55:46 -06:00
|
|
|
Using Akka with SBT
|
2011-05-08 10:23:05 +02:00
|
|
|
-------------------
|
|
|
|
|
|
2012-05-11 10:30:43 +02:00
|
|
|
The simplest way to get started with Akka and SBT is to check out the
|
|
|
|
|
`Akka/SBT template <http://typesafe.com/resources/getting-started/typesafe-stack/downloading-installing.html#template-projects-for-scala-akka-and-play>`_
|
|
|
|
|
project.
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-05-08 10:23:05 +02:00
|
|
|
Summary of the essential parts for using Akka with SBT:
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-08-26 17:25:18 +02:00
|
|
|
SBT installation instructions on `https://github.com/harrah/xsbt/wiki/Setup <https://github.com/harrah/xsbt/wiki/Setup>`_
|
2011-05-08 10:23:05 +02:00
|
|
|
|
2011-08-26 17:25:18 +02:00
|
|
|
``build.sbt`` file::
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-08-26 17:25:18 +02:00
|
|
|
name := "My Project"
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-08-26 17:25:18 +02:00
|
|
|
version := "1.0"
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-10-05 17:41:00 +02:00
|
|
|
scalaVersion := "2.9.1"
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-08-26 17:25:18 +02:00
|
|
|
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2012-03-05 10:50:54 +13:00
|
|
|
libraryDependencies += "com.typesafe.akka" % "akka-actor" % "2.1-SNAPSHOT"
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-05-08 10:23:05 +02:00
|
|
|
|
|
|
|
|
Using Akka with Eclipse
|
|
|
|
|
-----------------------
|
|
|
|
|
|
2011-12-15 15:39:30 +13:00
|
|
|
Setup SBT project and then use `sbteclipse <https://github.com/typesafehub/sbteclipse>`_ to generate Eclipse project.
|
2011-08-26 17:25:18 +02:00
|
|
|
|
2011-05-08 10:23:05 +02:00
|
|
|
Using Akka with IntelliJ IDEA
|
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
|
|
Setup SBT project and then use `sbt-idea <https://github.com/mpeltonen/sbt-idea>`_ to generate IntelliJ IDEA project.
|
|
|
|
|
|
2011-04-09 19:55:46 -06:00
|
|
|
Build from sources
|
2011-04-11 21:26:13 -06:00
|
|
|
------------------
|
2011-04-09 19:55:46 -06:00
|
|
|
|
|
|
|
|
Akka uses Git and is hosted at `Github <http://github.com>`_.
|
|
|
|
|
|
2012-03-05 10:27:00 +01:00
|
|
|
* Akka: clone the Akka repository from `<http://github.com/akka/akka>`_
|
2011-04-09 19:55:46 -06:00
|
|
|
|
2011-05-08 10:23:05 +02:00
|
|
|
Continue reading the page on :ref:`building-akka`
|
2011-04-09 19:55:46 -06:00
|
|
|
|
|
|
|
|
Need help?
|
2011-04-11 21:26:13 -06:00
|
|
|
----------
|
2011-04-09 19:55:46 -06:00
|
|
|
|
|
|
|
|
If you have questions you can get help on the `Akka Mailing List <http://groups.google.com/group/akka-user>`_.
|
|
|
|
|
|
2011-05-16 08:34:55 +02:00
|
|
|
You can also ask for `commercial support <http://typesafe.com>`_.
|
2011-04-09 19:55:46 -06:00
|
|
|
|
|
|
|
|
Thanks for being a part of the Akka community.
|