Merge pull request #17120 from akka/wip-15677-deprecate-microkernel-patriknw
=ker #15677 Deprecate Microkernel
This commit is contained in:
commit
54aa559fa4
22 changed files with 94 additions and 373 deletions
|
|
@ -12,21 +12,50 @@ Akka can be used in different ways:
|
|||
- As a library: used as a regular JAR on the classpath and/or in a web app, to
|
||||
be put into ``WEB-INF/lib``
|
||||
|
||||
- As a stand alone application by instantiating ActorSystem in a main class or
|
||||
using the :ref:`Microkernel (Scala) <microkernel-scala>` / :ref:`Microkernel (Java) <microkernel-java>`
|
||||
- Package with `sbt-native-packager <https://github.com/sbt/sbt-native-packager>`_
|
||||
|
||||
- Package and deploy using `Typesafe ConductR <http://typesafe.com/products/conductr>`_.
|
||||
|
||||
|
||||
Using Akka as library
|
||||
---------------------
|
||||
Native Packager
|
||||
===============
|
||||
|
||||
This is most likely what you want if you are building Web applications. There
|
||||
are several ways you can use Akka in Library mode by adding more and more
|
||||
modules to the stack.
|
||||
`sbt-native-packager <https://github.com/sbt/sbt-native-packager>`_ is a tool for creating
|
||||
distributions of any type of application, including an Akka applications.
|
||||
|
||||
Define sbt version in ``project/build.properties`` file:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sbt.version=0.13.7
|
||||
|
||||
Add `sbt-native-packager <https://github.com/sbt/sbt-native-packager>`_ in ``project/plugins.sbt`` file:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0-RC1")
|
||||
|
||||
Use the package settings and optionally specify the mainClass in ``build.sbt`` file:
|
||||
|
||||
.. includecode:: ../../../akka-samples/akka-sample-main-scala/build.sbt
|
||||
|
||||
|
||||
Using Akka as a stand alone microkernel
|
||||
----------------------------------------
|
||||
.. note:: Use the ``JavaServerAppPackaging``. Don't use ``AkkaAppPackaging`` (previously named
|
||||
``packageArchetype.akka_application``, since it doesn't have the same flexibility and quality
|
||||
as the ``JavaServerAppPackaging``.
|
||||
|
||||
Use sbt task ``dist`` package the application.
|
||||
|
||||
To start the application (on a unix-based system):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd target/universal/
|
||||
unzip akka-sample-main-scala-2.4-SNAPSHOT.zip
|
||||
chmod u+x akka-sample-main-scala-2.4-SNAPSHOT/bin/akka-sample-main-scala
|
||||
akka-sample-main-scala-2.4-SNAPSHOT/bin/akka-sample-main-scala sample.hello.Main
|
||||
|
||||
Use ``Ctrl-C`` to interrupt and exit the application.
|
||||
|
||||
On a Windows machine you can also use the ``bin\akka-sample-main-scala.bat`` script.
|
||||
|
||||
Akka can also be run as a stand-alone microkernel. See
|
||||
:ref:`Microkernel (Scala) <microkernel-scala>` / :ref:`Microkernel (Java) <microkernel-java>` for
|
||||
more information.
|
||||
|
|
|
|||
|
|
@ -17,9 +17,8 @@ Download
|
|||
--------
|
||||
|
||||
There are several ways to download Akka. You can download it as part of the Typesafe Platform
|
||||
(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.
|
||||
(as described above). You can download the full distribution, which includes all modules.
|
||||
Or you can use a build tool like Maven or SBT to download dependencies from the Akka Maven repository.
|
||||
|
||||
Modules
|
||||
-------
|
||||
|
|
@ -34,9 +33,6 @@ Akka is very modular and consists of several JARs containing different features.
|
|||
|
||||
- ``akka-cluster`` – Cluster membership management, elastic routers.
|
||||
|
||||
- ``akka-kernel`` – Akka microkernel for running a bare-bones mini application
|
||||
server
|
||||
|
||||
- ``akka-osgi`` – base bundle for using Akka in OSGi containers, containing the
|
||||
``akka-actor`` classes
|
||||
|
||||
|
|
@ -82,16 +78,6 @@ which includes proxies for several other repositories that Akka modules depend o
|
|||
|
||||
The use of Akka SNAPSHOTs, nightlies and milestone releases is discouraged unless you know what you are doing.
|
||||
|
||||
Microkernel
|
||||
-----------
|
||||
|
||||
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.
|
||||
|
||||
More information is available in the documentation of the
|
||||
:ref:`Microkernel (Scala) <microkernel-scala>` / :ref:`Microkernel (Java) <microkernel-java>`.
|
||||
|
||||
.. _build-tool:
|
||||
|
||||
Using a build tool
|
||||
|
|
|
|||
|
|
@ -75,12 +75,14 @@ Akka has both a :ref:`scala-api` and a :ref:`java-api`.
|
|||
Akka can be used in two different ways
|
||||
======================================
|
||||
|
||||
- As a library: used by a web app, to be put into ``WEB-INF/lib`` or as a regular
|
||||
JAR on your classpath.
|
||||
Akka can be used and deployed in different ways:
|
||||
|
||||
- As a microkernel: stand-alone kernel to drop your application into.
|
||||
- As a library: used as a regular JAR on the classpath and/or in a web app, to
|
||||
be put into ``WEB-INF/lib``
|
||||
|
||||
See the :ref:`deployment-scenarios` for details.
|
||||
- Package with `sbt-native-packager <https://github.com/sbt/sbt-native-packager>`_
|
||||
|
||||
- Package and deploy using `Typesafe ConductR <http://typesafe.com/products/conductr>`_.
|
||||
|
||||
Commercial Support
|
||||
==================
|
||||
|
|
|
|||
|
|
@ -19,13 +19,11 @@ but also in the size of applications it is useful for. The core of Akka, akka-ac
|
|||
is very small and easily dropped into an existing project where you need
|
||||
asynchronicity and lockless concurrency without hassle.
|
||||
|
||||
You can choose to include only the parts of akka you need in your application
|
||||
and then there's the whole package, the Akka Microkernel, which is a standalone
|
||||
container to deploy your Akka application in. With CPUs growing more and more
|
||||
cores every cycle, Akka is the alternative that provides outstanding performance
|
||||
even if you're only running it on one machine. Akka also supplies a wide array
|
||||
of concurrency-paradigms, allowing users to choose the right tool for the
|
||||
job.
|
||||
You can choose to include only the parts of akka you need in your application.
|
||||
With CPUs growing more and more cores every cycle, Akka is the alternative that
|
||||
provides outstanding performance even if you're only running it on one machine.
|
||||
Akka also supplies a wide array of concurrency-paradigms, allowing users to choose
|
||||
the right tool for the job.
|
||||
|
||||
|
||||
What's a good use-case for Akka?
|
||||
|
|
|
|||
|
|
@ -10,4 +10,5 @@ Utilities
|
|||
../common/duration
|
||||
../common/circuitbreaker
|
||||
extending-akka
|
||||
microkernel
|
||||
../intro/deployment-scenarios
|
||||
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
|
||||
.. _microkernel-java:
|
||||
|
||||
Microkernel
|
||||
==================
|
||||
|
||||
The purpose of the Akka Microkernel is to offer a bundling mechanism so that you can distribute
|
||||
an Akka application as a single payload, without the need to run in a Java Application Server or manually
|
||||
having to create a launcher script.
|
||||
|
||||
The Akka Microkernel is included in the Akka download found at `downloads`_.
|
||||
|
||||
.. _downloads: http://akka.io/downloads
|
||||
|
||||
To run an application with the microkernel you need to create a Bootable class
|
||||
that handles the startup and shutdown the application. An example is included below.
|
||||
|
||||
Put your application jar in the ``deploy`` directory and additional dependencies in the ``lib`` directory
|
||||
to have them automatically loaded and placed on the classpath.
|
||||
|
||||
To start the kernel use the scripts in the ``bin`` directory, passing the boot
|
||||
classes for your application.
|
||||
|
||||
The start script adds ``config`` directory first in the classpath, followed by ``lib/*``.
|
||||
It runs java with main class ``akka.kernel.Main`` and the supplied Bootable class as
|
||||
argument.
|
||||
|
||||
Example command (on a unix-based system):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
bin/akka sample.kernel.hello.HelloKernel
|
||||
|
||||
Use ``Ctrl-C`` to interrupt and exit the microkernel.
|
||||
|
||||
On a Windows machine you can also use the bin/akka.bat script.
|
||||
|
||||
The code for the Hello Kernel example (see the ``HelloKernel`` class for an example
|
||||
of creating a Bootable):
|
||||
|
||||
.. includecode:: ../../../akka-samples/akka-sample-hello-kernel/src/main/java/sample/kernel/hello/java/HelloKernel.java
|
||||
|
||||
|
||||
|
|
@ -192,3 +192,13 @@ Router configuration entries have also changed for the module, they use prefix `
|
|||
``cluster-metrics-adaptive-pool`` and ``cluster-metrics-adaptive-group``
|
||||
Metrics extension classes and objects are located in the new package ``akka.cluster.metrics``.
|
||||
Please see :ref:`Scala <cluster-metrics-scala>`, :ref:`Java <cluster-metrics-java>` for more information.
|
||||
|
||||
Microkernel is Deprecated
|
||||
=========================
|
||||
|
||||
Akka Microkernel is deprecated and will be removed. It is replaced by using an ordinary
|
||||
user defined main class and packaging with `sbt-native-packager <https://github.com/sbt/sbt-native-packager>`_
|
||||
or `Typesafe ConductR <http://typesafe.com/products/conductr>`_.
|
||||
Please see :ref:`deployment-scenarios` for more information.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,4 +10,5 @@ Utilities
|
|||
../common/duration
|
||||
../common/circuitbreaker
|
||||
extending-akka
|
||||
microkernel
|
||||
../intro/deployment-scenarios
|
||||
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
|
||||
.. _microkernel-scala:
|
||||
|
||||
Microkernel
|
||||
===================
|
||||
|
||||
The purpose of the Akka Microkernel is to offer a bundling mechanism so that you can distribute
|
||||
an Akka application as a single payload, without the need to run in a Java Application Server or manually
|
||||
having to create a launcher script.
|
||||
|
||||
The Akka Microkernel is included in the Akka download found at `downloads`_.
|
||||
|
||||
.. _downloads: http://akka.io/downloads
|
||||
|
||||
To run an application with the microkernel you need to create a Bootable class
|
||||
that handles the startup and shutdown the application.
|
||||
|
||||
The code for the Hello Kernel example (see the ``HelloKernel`` class for an example
|
||||
of creating a Bootable):
|
||||
|
||||
.. includecode:: ../../../akka-samples/akka-sample-hello-kernel/src/main/scala/sample/kernel/hello/HelloKernel.scala
|
||||
|
||||
|
||||
Add `sbt-native-packager <https://github.com/sbt/sbt-native-packager>`_ to the plugins.sbt
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.8.0-M2")
|
||||
|
||||
Use the package settings for ``akka_application``, and specify the mainClass in build.sbt
|
||||
|
||||
.. includecode:: ../../../akka-samples/akka-sample-hello-kernel/build.sbt
|
||||
|
||||
|
||||
Use sbt task ``stage`` to generate the start script. Also you can use task ``universal:packageZipTarball`` to package the application.
|
||||
|
||||
To start the application (on a unix-based system):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
./target/universal/stage/bin/hello-kernel
|
||||
|
||||
Use ``Ctrl-C`` to interrupt and exit the microkernel.
|
||||
|
||||
On a Windows machine you can also use the ``target\universal\stage\bin\hello-kernel.bat`` script.
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue