Enable additional-serialization-bindings by default, #22169
* and thereby it was also possibe to simplify the documentation in remoting
This commit is contained in:
parent
554d119446
commit
9df49be5d0
11 changed files with 56 additions and 98 deletions
|
|
@ -444,15 +444,16 @@ Note that the array based methods can be implemented by delegation like this:
|
|||
Disabling the Java Serializer
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
With Artery it is possible to completely disable Java Serialization for the entire Actor system.
|
||||
It is possible to completely disable Java Serialization for the entire Actor system.
|
||||
|
||||
Java serialization is known to be slow and prone to attacks of various kinds - it never was designed for high
|
||||
throughput messaging after all. However it is very convenient to use, thus it remained the default serialization
|
||||
mechanism that Akka used to serialize user messages as well as some of its internal messages in previous versions.
|
||||
Since the release of Artery, Akka internals do not rely on Java serialization anymore (exceptions to that being ``java.lang.Throwable`` and "remote deployment").
|
||||
|
||||
Akka internals do not rely on Java serialization (exceptions to that being ``java.lang.Throwable`` and "remote deployment").
|
||||
|
||||
.. note::
|
||||
When using Artery, Akka does not use Java Serialization for any of it's internal messages.
|
||||
Akka does not use Java Serialization for any of it's internal messages.
|
||||
It is highly encouraged to disable java serialization, so please plan to do so at the earliest possibility you have in your project.
|
||||
|
||||
One may think that network bandwidth and latency limit the performance of remote messaging, but serialization is a more typical bottleneck.
|
||||
|
|
|
|||
|
|
@ -287,47 +287,21 @@ For more information please see :ref:`serialization-scala`.
|
|||
Disabling the Java Serializer
|
||||
-----------------------------
|
||||
|
||||
Since the ``2.4.11`` release of Akka it is possible to entirely disable the default Java Serialization mechanism.
|
||||
Please note that :ref:`new remoting implementation (codename Artery) <remoting-artery-scala>` does not use Java
|
||||
serialization for internal messages by default. For compatibility reasons, the current remoting still uses Java
|
||||
serialization for some classes, however you can disable it in this remoting implementation as well by following
|
||||
the steps below.
|
||||
|
||||
The first step is to enable some additional serializers that replace previous Java serialization of some internal
|
||||
messages. This is recommended also when you can't disable Java serialization completely. Those serializers are
|
||||
enabled with this configuration:
|
||||
|
||||
.. code-block:: ruby
|
||||
|
||||
akka.actor {
|
||||
# Set this to on to enable serialization-bindings define in
|
||||
# additional-serialization-bindings. Those are by default not included
|
||||
# for backwards compatibility reasons. They are enabled by default if
|
||||
# akka.remote.artery.enabled=on.
|
||||
enable-additional-serialization-bindings = on
|
||||
}
|
||||
|
||||
The reason these are not enabled by default is wire-level compatibility between any 2.4.x Actor Systems.
|
||||
If you roll out a new cluster, all on the same Akka version that can enable these serializers it is recommended to
|
||||
enable this setting. When using :ref:`remoting-artery-scala` these serializers are enabled by default.
|
||||
|
||||
.. warning::
|
||||
Please note that when enabling the additional-serialization-bindings when using the old remoting,
|
||||
you must do so on all nodes participating in a cluster, otherwise the mis-aligned serialization
|
||||
configurations will cause deserialization errors on the receiving nodes.
|
||||
It is possible to completely disable Java Serialization for the entire Actor system.
|
||||
|
||||
Java serialization is known to be slow and prone to attacks of various kinds - it never was designed for high
|
||||
throughput messaging after all. However it is very convenient to use, thus it remained the default serialization
|
||||
mechanism that Akka used to serialize user messages as well as some of its internal messages in previous versions.
|
||||
Since the release of Artery, Akka internals do not rely on Java serialization anymore (one exception being ``java.lang.Throwable``).
|
||||
|
||||
Akka internals do not rely on Java serialization (exceptions to that being ``java.lang.Throwable`` and "remote deployment").
|
||||
|
||||
.. note::
|
||||
When using the new remoting implementation (codename Artery), Akka does not use Java Serialization for any of it's internal messages.
|
||||
Akka does not use Java Serialization for any of it's internal messages.
|
||||
It is highly encouraged to disable java serialization, so please plan to do so at the earliest possibility you have in your project.
|
||||
|
||||
One may think that network bandwidth and latency limit the performance of remote messaging, but serialization is a more typical bottleneck.
|
||||
|
||||
For user messages, the default serializer, implemented using Java serialization, remains available and enabled in Artery.
|
||||
|
||||
For user messages, the default serializer, implemented using Java serialization, remains available and enabled by default.
|
||||
We do however recommend to disable it entirely and utilise a proper serialization library instead in order effectively utilise
|
||||
the improved performance and ability for rolling deployments using Artery. Libraries that we recommend to use include,
|
||||
but are not limited to, `Kryo`_ by using the `akka-kryo-serialization`_ library or `Google Protocol Buffers`_ if you want
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue