Top Related Projects
Efficient reliable UDP unicast, UDP multicast, and IPC message transport
ZeroMQ core engine in C++, implements ZMTP/3.1
nanomsg library
High-Performance server for NATS.io, the cloud and edge native messaging system.
Mirror of Apache Kafka
Open source RabbitMQ: core server and tier 1 (built-in) plugins
Quick Overview
Aeron is a high-performance messaging system designed for reliable, unicast and multicast communication. It provides efficient, low-latency transport for data streaming applications, particularly suited for financial services and other industries requiring real-time data processing.
Pros
- Extremely low latency and high throughput performance
- Reliable message delivery with built-in flow control and congestion avoidance
- Supports both unicast and multicast communication
- Language-agnostic protocol with implementations in Java, C++, and .NET
Cons
- Steep learning curve due to its low-level nature and complex concepts
- Limited documentation and examples for advanced use cases
- May be overkill for simpler messaging needs
- Requires careful configuration and tuning for optimal performance
Code Examples
- Creating a publisher:
final Aeron aeron = Aeron.connect();
final Publication publication = aeron.addPublication("aeron:udp?endpoint=localhost:40123", 10);
final UnsafeBuffer buffer = new UnsafeBuffer(BufferUtil.allocateDirectAligned(256, 64));
buffer.putStringWithoutLengthAscii(0, "Hello, Aeron!");
long result = publication.offer(buffer);
- Creating a subscriber:
final Aeron aeron = Aeron.connect();
final Subscription subscription = aeron.addSubscription("aeron:udp?endpoint=localhost:40123", 10);
final FragmentHandler fragmentHandler = (buffer, offset, length, header) -> {
final String message = buffer.getStringWithoutLengthAscii(offset, length);
System.out.println("Received: " + message);
};
while (true) {
subscription.poll(fragmentHandler, 10);
}
- Configuring media driver:
final MediaDriver.Context ctx = new MediaDriver.Context()
.dirDeleteOnStart(true)
.threadingMode(ThreadingMode.SHARED)
.sharedIdleStrategy(new BackoffIdleStrategy(1, 10, 1000, 1_000_000));
try (MediaDriver driver = MediaDriver.launch(ctx)) {
// Use the media driver
}
Getting Started
To get started with Aeron, follow these steps:
-
Add Aeron dependency to your project (e.g., Maven):
<dependency> <groupId>io.aeron</groupId> <artifactId>aeron-all</artifactId> <version>1.38.1</version> </dependency>
-
Launch the Media Driver:
final MediaDriver driver = MediaDriver.launch();
-
Create an Aeron instance:
final Aeron aeron = Aeron.connect();
-
Create a publication or subscription as shown in the code examples above.
-
Remember to close resources when done:
aeron.close(); driver.close();
For more detailed information and advanced usage, refer to the official Aeron documentation and examples in the GitHub repository.
Competitor Comparisons
Efficient reliable UDP unicast, UDP multicast, and IPC message transport
Pros of Aeron
- More active development with frequent updates and contributions
- Larger community support and wider adoption in production environments
- Extensive documentation and examples for various use cases
Cons of Aeron
- Higher learning curve due to more complex architecture
- Requires more system resources for optimal performance
- May be overkill for simpler messaging needs
Code Comparison
Aeron (Java):
final Aeron aeron = Aeron.connect();
final Publication publication = aeron.addPublication("aeron:udp?endpoint=localhost:40123", 10);
final UnsafeBuffer buffer = new UnsafeBuffer(ByteBuffer.allocate(256));
buffer.putStringWithoutLengthAscii(0, "Hello, Aeron!");
publication.offer(buffer);
Aeron> (C++):
aeron::Context context;
auto aeron = aeron::Aeron::connect(context);
auto publication = aeron->addPublication("aeron:udp?endpoint=localhost:40123", 10);
std::array<std::uint8_t, 256> buffer;
std::copy_n("Hello, Aeron!", 13, buffer.begin());
publication->offer(buffer);
Both repositories provide high-performance messaging solutions, but Aeron offers more features and broader language support. Aeron> focuses on C++ implementation, which may be preferable for specific use cases or environments where C++ is the primary language.
ZeroMQ core engine in C++, implements ZMTP/3.1
Pros of libzmq
- More mature and widely adopted, with extensive documentation and community support
- Supports multiple transport protocols (TCP, IPC, inproc, PGM, EPGM)
- Flexible messaging patterns (pub-sub, request-reply, push-pull, etc.)
Cons of libzmq
- Higher latency compared to Aeron, especially for high-throughput scenarios
- More complex API and configuration options, which can lead to steeper learning curve
- Lacks built-in support for reliable UDP multicast
Code Comparison
libzmq:
void *context = zmq_ctx_new();
void *socket = zmq_socket(context, ZMQ_REQ);
zmq_connect(socket, "tcp://localhost:5555");
zmq_send(socket, "Hello", 5, 0);
zmq_close(socket);
zmq_ctx_destroy(context);
Aeron:
Aeron aeron = Aeron.connect();
Publication publication = aeron.addPublication("aeron:udp?endpoint=localhost:40123", 10);
UnsafeBuffer buffer = new UnsafeBuffer(ByteBuffer.allocate(256));
buffer.putStringWithoutLengthAscii(0, "Hello");
publication.offer(buffer);
Both libraries provide efficient messaging capabilities, but Aeron focuses on ultra-low latency and high throughput, particularly for UDP multicast scenarios. libzmq offers more flexibility in terms of messaging patterns and transport protocols, making it suitable for a wider range of use cases. The choice between the two depends on specific performance requirements and the complexity of the messaging system needed.
nanomsg library
Pros of nanomsg
- Simpler API and easier to use for basic messaging patterns
- Supports multiple transport protocols (TCP, IPC, WebSocket)
- Lightweight and has a smaller footprint
Cons of nanomsg
- Lower performance compared to Aeron, especially in high-throughput scenarios
- Less feature-rich, lacking advanced capabilities like reliable multicast
- Development has slowed down in recent years
Code Comparison
nanomsg:
nn_socket_t sock = nn_socket(AF_SP, NN_PUB);
nn_bind(sock, "tcp://*:5555");
nn_send(sock, "Hello, World!", 13, 0);
Aeron:
Aeron aeron = Aeron.connect();
Publication publication = aeron.addPublication("aeron:udp?endpoint=localhost:40123", 10);
UnsafeBuffer buffer = new UnsafeBuffer(ByteBuffer.allocate(256));
buffer.putStringWithoutLengthAscii(0, "Hello, World!");
publication.offer(buffer);
Both libraries provide messaging capabilities, but Aeron offers more advanced features and higher performance at the cost of increased complexity. nanomsg is simpler to use and supports multiple transport protocols, making it suitable for smaller projects or those requiring flexibility. Aeron excels in high-performance, low-latency scenarios, particularly in financial and gaming applications.
High-Performance server for NATS.io, the cloud and edge native messaging system.
Pros of NATS Server
- Simpler to set up and use, with a more straightforward API
- Built-in support for various messaging patterns (pub/sub, request/reply, etc.)
- Wider language support and ecosystem
Cons of NATS Server
- Generally lower throughput and higher latency compared to Aeron
- Less fine-grained control over network and protocol details
- Not as optimized for ultra-low latency scenarios
Code Comparison
NATS Server (Go):
nc, err := nats.Connect(nats.DefaultURL)
if err != nil {
log.Fatal(err)
}
nc.Publish("foo", []byte("Hello World"))
Aeron (Java):
Aeron aeron = Aeron.connect();
Publication publication = aeron.addPublication("aeron:udp?endpoint=localhost:40123", 10);
UnsafeBuffer buffer = new UnsafeBuffer(ByteBuffer.allocate(256));
buffer.putStringWithoutLengthAscii(0, "Hello World");
publication.offer(buffer);
The code snippets demonstrate the basic usage of each library for publishing a message. NATS Server has a more straightforward API, while Aeron provides more low-level control and requires more setup.
Both projects are open-source and actively maintained, with NATS Server having a larger community and more diverse use cases, while Aeron is more focused on high-performance, low-latency scenarios in specific industries like finance.
Mirror of Apache Kafka
Pros of Kafka
- Robust ecosystem with extensive tooling and integrations
- Scalable architecture supporting high-throughput, distributed streaming
- Strong community support and widespread adoption in enterprise environments
Cons of Kafka
- Higher latency compared to Aeron's ultra-low latency design
- More complex setup and configuration process
- Heavier resource consumption, especially for smaller-scale applications
Code Comparison
Kafka producer example:
Properties props = new Properties();
props.put("bootstrap.servers", "localhost:9092");
props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
Producer<String, String> producer = new KafkaProducer<>(props);
Aeron publisher example:
Aeron aeron = Aeron.connect();
Publication publication = aeron.addPublication("aeron:udp?endpoint=localhost:40123", 10);
UnsafeBuffer buffer = new UnsafeBuffer(ByteBuffer.allocate(256));
buffer.putStringWithoutLengthAscii(0, "Hello, Aeron!");
publication.offer(buffer);
Both Kafka and Aeron are messaging systems, but they serve different purposes. Kafka is designed for high-throughput distributed streaming, while Aeron focuses on ultra-low latency messaging. Kafka offers a more comprehensive ecosystem and is widely adopted in enterprise environments, whereas Aeron provides better performance for latency-sensitive applications.
Open source RabbitMQ: core server and tier 1 (built-in) plugins
Pros of RabbitMQ
- More mature and widely adopted messaging system with extensive documentation
- Supports multiple messaging protocols (AMQP, MQTT, STOMP)
- Built-in management UI for easier monitoring and administration
Cons of RabbitMQ
- Higher latency compared to Aeron's ultra-low latency design
- More complex setup and configuration process
- Potentially lower throughput in high-performance scenarios
Code Comparison
RabbitMQ (Erlang):
basic_publish(Channel, <<"my_exchange">>, <<"routing_key">>, <<"Hello, World!">>),
{#'basic.deliver'{delivery_tag = Tag}, Content} = basic_consume(Channel, <<"my_queue">>),
basic_ack(Channel, Tag)
Aeron (Java):
publication.offer(buffer, 0, messageLength);
subscription.poll(fragmentHandler, fragmentLimit);
RabbitMQ uses a more high-level API with built-in concepts like exchanges and queues, while Aeron provides a lower-level, more direct approach to message passing. Aeron's code is more concise but requires more manual handling of buffers and message fragmentation.
Both projects are open-source and actively maintained, with RabbitMQ having a larger community and more extensive ecosystem. Aeron focuses on ultra-low latency and high throughput, making it suitable for specific use cases where performance is critical, while RabbitMQ offers a more general-purpose messaging solution with broader protocol support and easier management.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Aeron
Efficient reliable UDP unicast, UDP multicast, and IPC message transport. Java, C, and C++ clients are available in this repository, and a .NET client is available. All 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 the latest version information and changes see the Change Log with Java downloads at Maven Central.
Aeron is owned and operated by Adaptive Financial Consulting. Originally created by Martin Thompson and Todd Montgomery, the Aeron team joined Adaptive in 2022.
For Business users, to get started with Aeron Premium, please visit Aeron.io
We provide a range of services including:
- Training for development and operations with Aeron and Aeron Cluster.
- Consulting, for example if youâre not sure how to design your system or need help tuning your system.
- We also offer a number of proprietary enhancements on top of Aeron and Aeron Cluster such as kernel bypass (ef_vi, AWS DPDK, and VMA) for increased performance, and blazing fast encryption with ATS.
- If youâre building a new trading system, we have experienced Aeron developers who can help.
Please get in touch at sales@aeron.io if you would like to learn more about any of these.
How do I use Aeron?
- Java Programming Guide
- C++11 Programming Guide
- Best Practices Guide
- Monitoring and Debugging
- Configuration Options
- Channel Specific Configuration
- Aeron Archive (Durable/Persistent Stream Storage)
- Aeron Cluster (Fault Tolerant Services)
- Aeron Docs
How does Aeron work?
- Transport Protocol Specification
- Design Overview
- Design Principles
- Flow Control Semantics
- Media Driver Operation
How do I hack on Aeron?
License (See LICENSE file for full license)
Copyright 2014-2025 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.
Top Related Projects
Efficient reliable UDP unicast, UDP multicast, and IPC message transport
ZeroMQ core engine in C++, implements ZMTP/3.1
nanomsg library
High-Performance server for NATS.io, the cloud and edge native messaging system.
Mirror of Apache Kafka
Open source RabbitMQ: core server and tier 1 (built-in) plugins
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot