MCPcopy Index your code
hub / github.com/aeron-io/simple-binary-encoding

github.com/aeron-io/simple-binary-encoding @1.39.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.39.0 ↗ · + Follow
4,151 symbols 17,709 edges 337 files 742 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Simple Binary Encoding (SBE)

Javadocs GitHub

Actions Status CodeQL Status

SBE is an OSI layer 6 presentation for encoding and decoding binary application messages for low-latency financial applications. This repository contains the reference implementations in Java, C, C++, C#, Golang and Rust.

More details on the design and usage of SBE can be found on the Wiki.

An XSD for SBE specs can be found here. Please address questions about the specification to the SBE FIX community.

For the latest version information and changes see the Change Log with downloads at Maven Central.

The Java and C++ SBE implementations work very efficiently with the Aeron messaging system for low-latency and high-throughput communications. The Java SBE implementation has a dependency on Agrona for its buffer implementations.

Binaries

Binaries and dependency information for Maven, Ivy, Gradle, and others can be found at http://search.maven.org.

Example for Maven:

<dependency>
    <groupId>uk.co.real-logic</groupId>
    <artifactId>sbe-tool</artifactId>
    <version>${sbe.tool.version}</version>
</dependency>

Build

Build the project with Gradle using this build.gradle file.

Full clean build:

$ ./gradlew

Run the Java examples

$ ./gradlew runJavaExamples

Distribution

Jars for the executable, source, and javadoc for the various modules can be found in the following directories:

sbe-benchmarks/build/libs
sbe-samples/build/libs
sbe-tool/build/libs
sbe-all/build/libs

An example to execute a Jar from command line using the 'all' jar which includes the Agrona dependency:

java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dsbe.generate.ir=true -Dsbe.target.language=Cpp -Dsbe.target.namespace=sbe -Dsbe.output.dir=include/gen -Dsbe.errorLog=yes -jar sbe-all/build/libs/sbe-all-${SBE_TOOL_VERSION}.jar my-sbe-messages.xml

C++ Build using CMake

NOTE: Linux, Mac OS, and Windows only for the moment. See FAQ. Windows builds have been tested with Visual Studio Express 12.

For convenience, the cppbuild script does a full clean, build, and test of all targets as a Release build.

$ ./cppbuild/cppbuild

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

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

Note: The C++ build includes the C generator. Currently, the C generator is a work in progress.

Golang Build

First build using Gradle to generate the SBE jar and then use it to generate the golang code for testing.

$ ./gradlew
$ ./gradlew generateGolangCodecs

For convenience on Linux, a gnu Makefile is provided that runs some tests and contains some examples.

$ cd gocode
# make # test, examples, bench

Go supports both generating Go structs with encode / decode methods, and flyweights like the other languages. Structs are generated by default for compatibility. Set sbe.go.generate.generate.flyweights=true to generate flyweights.

Users of golang generated code should see the user documentation.

Developers wishing to enhance the golang generator should see the developer documentation

C# Build

Users of CSharp generated code should see the user documentation.

Developers wishing to enhance the CSharp generator should see the developer documentation

Rust Build

The SBE Rust generator will produce 100% safe rust crates (no unsafe code will be generated). Generated crates do not have any dependencies on any libraries (including no SBE libraries). If you don't yet have Rust installed see Rust: Getting Started

Generate the Rust codecs

$ ./gradlew generateRustCodecs

Run the Rust test from Gradle

$ ./gradlew runRustTests

Or run test directly with Cargo

$ cd rust
$ cargo test

License (See LICENSE file for full license)

Copyright 2013-2025 Real Logic Limited.
Copyright 2017 MarketFactory Inc.

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.

Extension points exported contracts — how you extend this code

TargetCodeGenerator (Interface)
Target a code generator for a given language. [13 implementers]
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/TargetCodeGenerator.java
CodeGenerator (Interface)
Abstraction for code generators to implement. [25 implementers]
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/CodeGenerator.java
SchemaTransformer (Interface)
An abstraction that allows for general transformations of the IR. [6 implementers]
sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/SchemaTransformer.java
TypeSchema (Interface)
(no doc) [5 implementers]
sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/schema/TypeSchema.java
TokenListener (Interface)
Callback interface to be implemented by code wanting to decode messages on-the-fly. If all methods are not required [2 …
sbe-tool/src/main/java/uk/co/real_logic/sbe/otf/TokenListener.java

Core symbols most depended-on inside this repo

append
called by 3595
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java
append
called by 3400
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/csharp/CSharpUtil.java
next
called by 823
sbe-tool/src/main/golang/json/json_token_listener.go
indent
called by 748
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/rust/RustUtil.java
encoding
called by 569
sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/Token.java
get
called by 339
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/TargetCodeGeneratorLoader.java
primitiveType
called by 270
sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/Encoding.java
name
called by 244
sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/Token.java

Shape

Method 3,513
Function 294
Class 271
Enum 28
Struct 17
FuncType 11
Interface 11
TypeAlias 6

Languages

Java72%
Go11%
C#9%
C++6%
Rust2%
C1%

Modules by API surface

sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecDecoder.java259 symbols
sbe-tool/src/test/java/uk/co/real_logic/sbe/FieldAccessOrderCheckTest.java191 symbols
sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecEncoder.java191 symbols
csharp/sbe-tests/FieldAccessOrderCheckTests.cs168 symbols
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java123 symbols
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/common/FieldPrecedenceModel.java109 symbols
sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecDecoder.java89 symbols
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppGenerator.java86 symbols
sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecEncoder.java70 symbols
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/csharp/CSharpGenerator.java70 symbols
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/rust/RustGenerator.java69 symbols
sbe-tool/src/main/golang/otf/encoding.go65 symbols

For agents

$ claude mcp add simple-binary-encoding \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact