Aeron

高效可靠的 UDP 单播、UDP 多播和 IPC 消息传输。「Efficient reliable UDP unicast, UDP multicast, and IPC message transport」

Github stars Tracking Chart

Aeron

高效可靠的 UDP 单播、UDP 多播和 IPC 消息传输。在这个资源库里有 Java 和 C++ 客户端,第三方有一个 .NET 的客户端。所有这三个客户端都可以在机器间交换消息,或者在同一台机器上通过 IPC 交换,非常有效。消息流可以由 Archive 模块记录到持久性存储中,以便日后或实时重放。Aeron Cluster 为基于 Raft 共识算法的复制状态机的容错服务提供支持。

性能是关键的重点。Aeron 的设计目标是在任何信息传递系统中以最低和最可预测的延迟达到最高的吞吐量。Aeron 集成了 简单二进制编码(SBE),以获得最佳的消息编码和解码性能。在创建 Aeron 时使用的许多数据结构已经被分解到 Agrona 项目中。

有关使用细节、协议规范、常见问题等,请查看 Wiki

对于那些喜欢看视频的人来说,可以试试 StrangeLoop 2014 的 Aeron Messaging。虽然性能和功能都有了很大的进步,但基本的设计仍然适用。

关于最新的版本信息和变化,请参见 Maven 中心的变更日志和 Java 下载。

Aeron 的商业支持、培训和开发可从 sales@real-logic.co.uk 获得。高级功能,如 Solarflare ef_vi 传输绑定,可进一步减少 20-60 %的延迟,具体取决于使用和配置,以及用于加密通信的 ATS(Aeron 传输安全)的安全性,可供商业支持的客户使用。


Main metrics

Overview
Name With Owneraeron-io/aeron
Primary LanguageJava
Program languageCMake (Language Count: 8)
PlatformLinux, Mac, Docker
License:Apache License 2.0
所有者活动
Created At2014-02-07 17:16:58
Pushed At2025-07-29 16:49:44
Last Commit At2025-07-25 23:38:02
Release Count158
Last Release Name1.48.5 (Posted on )
First Release Name0.1 (Posted on )
用户参与
Stargazers Count8k
Watchers Count349
Fork Count0.9k
Commits Count18.2k
Has Issues Enabled
Issues Count849
Issue Open Count16
Pull Requests Count786
Pull Requests Open Count11
Pull Requests Close Count194
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Aeron

Gitter To chat with other Aeron users and contributors.

GitHub
Javadocs

Actions Status
Total Alerts
Code Quality: Java
Code Quality: C/C++

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.

Performance is the key focus. Aeron is designed to be the highest throughput with the lowest and most predictable
latency possible of any messaging system. Aeron integrates with
Simple Binary Encoding (SBE) for the best possible performance
in message encoding and decoding. 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.

How do I use Aeron?

  1. Java Programming Guide
  2. C++11 Programming Guide
  3. Best Practices Guide
  4. Monitoring and Debugging
  5. Configuration Options
  6. Channel Specific Configuration
  7. Aeron Archive (Durable/Persistent Stream Storage)

How does Aeron work?

  1. Transport Protocol Specification
  2. Design Overview
  3. Design Principles
  4. Flow Control Semantics
  5. Media Driver Operation

How do I hack on Aeron?

  1. Hacking on Aeron
  2. Performance Testing

Build

Java Build

The project is built with Gradle using this
build.gradle file.

You require the following to build Aeron:

  • JDK 8 or later, Java versions before 1.8.0_65 are very buggy and can cause tests to fail. Aeron is tested and supported on Java 8 & Java 11.

You must first build and install Agrona and
Simple Binary Encoding (SBE) into the local maven repository if the current master for Aeron depends on changes to Agrona or SBE. However we will try to not have this as the typical case.

    $ ./gradlew

After Agrona & SBE are compiled and installed, then you can build Aeron.

Full clean and build of all modules

    $ ./gradlew

C++ Build

You require the following to build the C++ API for Aeron:

  • 3.1.3 or higher of CMake
  • C++11 supported compiler for the supported platform
  • C11 supported compiler for the supported platform
  • Requirements to build HdrHistogram_c. HdrHistogram requires
    zlib.h currently. So on Ubuntu:
    $ sudo apt-get install libz-dev

Note: Aeron is supported on Linux, Mac, and Windows. Windows builds require Visual Studio and are being developed
with Visual Studio 2017 with 64-bit builds only. Cygwin, MSys, etc. may work, but are not maintained at this time.
Windows builds require 7z to unzip the zlib source archive.

For convenience, a script is provided that does a full clean, build, and test of all targets as a Release build.

    $ ./cppbuild/cppbuild

If you are comfortable with using CMake, then a full clean, build, and test looks like:

    $ mkdir -p cppbuild/Debug
    $ cd cppbuild/Debug
    $ cmake ../..
    $ cmake --build . --clean-first
    $ ctest

C Media Driver

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_DRIVER being set to OFF.

Note: C Media Driver is currently only supported on Mac and Linux (Windows version is experimental).

For dependencies and other information, see the
README.

Documentation

If you have doxygen installed and want to build the Doxygen doc, there is a nice doc target that can be used.

    $ make doc

Packaging

If you would like a packaged version of the compiled API, there is the package target 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 cpack directly.

    $ make package

Running Samples

Start up a media driver which will create the data and conductor directories. On Linux, this will probably be in
/dev/shm/aeron or /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 BasicSubscriber from a command line. On Linux, this will be pointing to the /dev/shm shared memory
directory, so be sure your MediaDriver is doing the same!

    $ java -cp aeron-samples/build/libs/samples.jar io.aeron.samples.BasicSubscriber

You can run the BasicPublisher from a command line. On Linux, this will be pointing to the /dev/shm shared memory
directory, so be sure your MediaDriver is doing the same!

    $ java -cp aeron-samples/build/libs/samples.jar io.aeron.samples.BasicPublisher

You can run the AeronStat utility to read system counters from a command line

    $ java -cp aeron-samples/build/libs/samples.jar io.aeron.samples.AeronStat

Media Driver Packaging

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

Troubleshooting

  1. On linux, the subscriber sample throws an exception

     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/aeron or /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-size argument for docker run or shm_size in docker-compose.yaml.

License (See LICENSE file for full license)

Copyright 2014-2020 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.