Efficient reliable UDP unicast, UDP multicast, and IPC message transport
Efficient reliable UDP unicast, UDP multicast, and IPC message transport. Java and C++ clients are available in this repository, and a .NET client is available from a 3rd party. All three clients can exchange messages across machines, or on the same machine via IPC, very efficiently. Message streams can be recorded by the Archive module to persistent storage for later, or real-time, replay. Aeron Cluster provides support for fault-tolerant services as replicated state machines based on the Raft consensus algorithm.
Performance is the key focus. A design goal for Aeron is to be the highest throughput with the lowest and most predictable latency of any messaging system. Aeron integrates with Simple Binary Encoding (SBE) for the best possible message encoding and decoding performance. Many of the data structures used in the creation of Aeron have been factored out to the Agrona project.
For details of usage, protocol specification, FAQ, etc. please check out the Wiki.
For those who prefer to watch a video then try Aeron Messaging from StrangeLoop 2014. Things have advanced quite a bit with performance and features, but the basic design still applies.
For the latest version information and changes see the Change Log with Java downloads at Maven Central.
Commercial support, training, and development on Aeron is available from [email protected]. Premium features such as Solarflare ef_vi transport bindings for a further 40-60% reduction in latency, and security with ATS (Aeron Transport Security) for encrypted communications is available to customers on commercial support.
Build the project with Gradle using this build.gradle file.
You will require the Java 8+ to build Aeron:
Full clean and build of all modules
$ ./gradlew
You require the following to build the C++ API for Aeron:
Note: Aeron support is available for 64-bit Linux, OSX, and Windows.
For convenience, the
cppbuildscript does a full clean, build, and test of all targets as a Release build.
$ ./cppbuild/cppbuild
For those comfortable with CMake - then a clean, build, and test looks like:
$ mkdir -p cppbuild/Debug $ cd cppbuild/Debug $ cmake ../.. $ cmake --build . --clean-first $ ctest
By default, the C Media Driver is built as part of the C++ Build. However, it can be disabled via the CMake option
BUILD_AERON_DRIVERbeing set to
OFF.
Note: C Media Driver is supported on Mac and Linux, the Windows version is experimental.
For dependencies and other information, see the README.
If you have doxygen installed and want to build the Doxygen doc, there is a nice
doctarget that can be used.
$ make doc
If you would like a packaged version of the compiled API, there is the
packagetarget that uses CPack. If the doc has been built previous to the packaging, it will be included. Packages created are "TGZ;STGZ", but can be changed by running
cpackdirectly.
$ make package
Start up a media driver which will create the data and conductor directories. On Linux, this will probably be in
/dev/shm/aeronor
/tmp/aeron.
$ java -cp aeron-samples/build/libs/samples.jar io.aeron.driver.MediaDriver
Alternatively, specify the data and conductor directories. The following example uses the shared memory 'directory' on Linux, but you could just as easily point to the regular filesystem.
$ java -cp aeron-samples/build/libs/samples.jar -Daeron.dir=/dev/shm/aeron io.aeron.driver.MediaDriver
You can run the
BasicSubscriberfrom a command line. On Linux, this will be pointing to the
/dev/shmshared memory directory, so be sure your
MediaDriveris doing the same!
$ java -cp aeron-samples/build/libs/samples.jar io.aeron.samples.BasicSubscriber
You can run the
BasicPublisherfrom a command line. On Linux, this will be pointing to the
/dev/shmshared memory directory, so be sure your
MediaDriveris doing the same!
$ java -cp aeron-samples/build/libs/samples.jar io.aeron.samples.BasicPublisher
You can run the
AeronStatutility to read system counters from a command line
$ java -cp aeron-samples/build/libs/samples.jar io.aeron.samples.AeronStat
The Media Driver is packaged by the default build into an application that can be found here
aeron-driver/build/distributions/aeron-driver-${VERSION}.zip
java.lang.InternalError(a fault occurred in a recent unsafe memory access operation in compiled Java code)
This is actually an out of disk space issue.
To alleviate, check to make sure you have enough disk space.
In the samples, on Linux, this will probably be either at
/dev/shm/aeronor
/tmp/aeron(depending on your settings).
See this thread for a similar problem.
Note: if you are trying to run this inside a Linux Docker, be aware that, by default, Docker only allocates 64 MB to the shared memory space at
/dev/shm. However, the samples will quickly outgrow this.
You can work around this issue by using the
--shm-sizeargument for
docker runor
shm_sizein
docker-compose.yaml.
Copyright 2014-2021 Real Logic Limited.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.