Framework
sofastack/sofa-bolt avatar
sofastack/sofa-bolt

SOFABolt: a Netty-based remoting framework for Java middleware

SOFABolt is a lightweight, easy to use and high performance remoting framework based on Netty.

2,505 stars868 forksJavaApache-2.0

At a glance

What is it?
SOFABolt packages connection management, four invocation models and a private RPC protocol on top of Netty, so Java teams do not rebuild a communication layer. The trade-off is that adopting it means adopting its protocol and its abstractions.
Who is it for?
Adopt SOFABolt if you are building Java middleware or an RPC product and want connection management, four invocation models and a codec skeleton already assembled, and if you accept its protocol and UserProcessor abstractions. Do not adopt it if you need a standardised wire protocol that non-Java peers already speak, or if a thin Netty pipeline is enough for your traffic.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 35 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What SOFABolt takes off a Java middleware team's plate

The README states the problem plainly: Netty exists so Java programmers do not have to implement NIO themselves, and SOFABolt exists so middleware developers do not have to build a communication framework over and over. That is the whole pitch. It is aimed at people writing RPC products, message brokers, distributed transaction coordinators, distributed switches and config centres, not at application developers who just want to call a remote method.

The README says the framework has been used inside Ant Group's middleware, naming SOFARPC, the messaging centre, distributed transactions, distributed switches and the config centre as users. It also lists external adopters including banks, brokerages and payment companies. Treat that list as evidence of production exposure, not as a benchmark. The README publishes no latency or throughput numbers, and none should be inferred from the user logos.

If your problem is "I have a Java service and I want to call another one over the network", this is probably one layer lower than what you need. SOFABolt gives you the transport, the invocation model and the protocol skeleton. It does not give you service discovery, load balancing or a registry.

Inside the framework: remoting core, protocol skeleton, RPC protocol

The README splits the codebase into three layers, and the split is the most useful thing to understand before reading any source.

The remoting core covers Netty's IO and threading model, connection management (lock-free connection establishment, scheduled disconnection, automatic reconnection), four communication models (oneway, sync, future, callback), timeout control, batch unpacking and batch submission processors, and heartbeat plus IDLE event handling. These are the pieces every long-lived TCP client eventually needs and nobody enjoys writing.

The protocol skeleton is where you get command and command-processor abstractions, codec processors and a heartbeat trigger. This is the layer you use if you have your own wire format. You define Command types, their processors and their encoders and decoders against the interfaces SOFABolt already provides, and the remoting core keeps working underneath.

The third layer is a ready-made private RPC protocol: an RPC communication protocol design, flexible control over when deserialisation happens, a FailFast mechanism for request-processing timeouts, the UserProcessor interface for application handlers, and duplex communication. The README presents two usage modes that map onto these layers: use the built-in RPC protocol directly and register a UserProcessor, or use SOFABolt as a protocol framework and supply your own Command definitions. The diagram in the README contrasts the Command structures of the RPC protocol and a messaging protocol to make the second mode concrete.

One design detail worth pausing on is the flexible deserialisation timing. Deserialising on the IO thread is cheap in latency terms and expensive in throughput terms; deferring it to a business thread pool inverts that. SOFABolt exposes the choice rather than making it for you, which is the right call for a framework aimed at middleware authors and an extra decision for everyone else.

Using SOFABolt as a communication framework from a Java project

SOFABolt is published to Maven Central under the group and artifact shown in the README's version badge, com.alipay.sofa:bolt. The README does not pin a version in prose, so take the current one from Maven Central rather than copying a number from an article.

The README does not inline dependency or bootstrap snippets. It points to the user handbook in the project wiki, and specifically to the section on the basic communication model, for a worked demo. According to the README, starting a client and a server and registering a user request processor is enough to complete a remote call, with connection management and heartbeats available by default. The exact class names and configuration keys are in the handbook, not in the README, so do not guess at them.

What the handbook example is described as producing: a server that accepts connections, a client that establishes them without an explicit lock, and a registered processor that receives deserialised request objects and returns responses. Heartbeat and IDLE handling run without configuration. The four invocation types (oneway, sync, future, callback) are selected at the call site, not at connection setup, which is why the README illustrates them as a separate diagram from the connection model.

If Maven is not your build tool, the repository ships mvnw and mvnw.cmd at the top level, so the project itself can be built without a preinstalled Maven. That is for building SOFABolt, not for consuming it.

Where SOFABolt is the wrong choice

The built-in protocol is private. That is not a defect, it is the point, but it decides a lot of architecture questions for you. If you need browsers, Go services, Python services or third-party vendors to talk to your endpoints without a SOFABolt client, the built-in RPC protocol will not do it. The README acknowledges this gap by listing separate implementations for node, python and cpp, which means cross-language support is a set of sibling projects rather than a protocol specification other people implement. Each of those clients has its own release cadence and its own completeness relative to the Java version.

Second, the framework assumes a long-lived connection between peers that both run SOFABolt. It is not an HTTP gateway and the README does not present it as one.

Third, the abstraction surface is real. Command, CommandProcessor, codec processors, UserProcessor, timeout FailFast: if your traffic is a few hundred requests per second between two internal services, a plain Netty pipeline with a length-field decoder is less code to own and less to explain to the next engineer. SOFABolt pays off when you have many connections, mixed invocation semantics and a need for reconnection behaviour you did not write yourself.

Finally, the README does not document rollback or protocol version negotiation. If you deploy a wire-format change, the repository gives no stated procedure for reverting it.

SOFABolt against gRPC and plain Netty

gRPC is the obvious alternative, and the difference is not performance, it is who owns the contract. gRPC defines its wire format in a published specification and generates clients for every mainstream language from a .proto file. SOFABolt defines its wire format in Java code and ships sibling clients for node, python and cpp. With gRPC, a new language is a codegen run; with SOFABolt, a new language is a port.

In exchange, SOFABolt gives you things gRPC's default surface does not put in front of you: four invocation models with oneway and callback alongside the request-response pair, batch unpacking and batch submission processors, and a FailFast path for request-processing timeouts. Its connection management handles lock-free establishment, scheduled disconnection and automatic reconnection as framework behaviour rather than application code.

Plain Netty is the other comparison, and it is a fair one. Netty gives you the event loop, the pipeline and the codecs. SOFABolt gives you the layer above: what happens to a request after the bytes are decoded, how many in-flight requests a connection tolerates, what a timeout means, and what a heartbeat does when the peer goes quiet. Choosing plain Netty is choosing to answer those questions yourself. That is a legitimate choice, and the README's own framing concedes it: Netty exists so you do not write NIO, SOFABolt exists so you do not write the communication framework.

Maintenance, releases and the Apache-2.0 licence

The repository is not archived, and the last push to master was on 2026-08-26. The most recent tagged release in the repository's release list is v1.6.12 from 2025-04-21, following v1.6.11 in December 2024 and v1.6.10 in May 2024. The pattern is roughly one tagged minor release every several months, with commits landing between tags. That is a maintenance rhythm typical of a component that is mature and feature-complete rather than one under heavy churn, and it means you should not expect a fix for your specific issue to arrive on a weekly cadence.

Upgrade cost is dominated by the wire protocol rather than the API. Because the built-in protocol is private, a client and server built against different SOFABolt versions need to agree on the bytes. The README does not state a compatibility policy across minor versions, so this is something to establish for yourself before upgrading a fleet.

The licence is Apache-2.0, per the LICENSE file and the badge in the README. That permits commercial use and modification, and it includes a patent grant. It also means the project carries no warranty, and there is no support contract attached to the open source distribution. The README describes code contributions as requiring a signed agreement, and refers to CONTRIBUTING.md for the process and to LICENSE for the terms governing modifications. This is a description of what the repository says, not legal advice; if you are redistributing a modified SOFABolt, have your own counsel read the LICENSE and the HEADER file.

Editorial conclusion

Adopt SOFABolt if you are building Java middleware or an RPC product and want connection management, four invocation models and a codec skeleton already assembled, and if you accept its protocol and UserProcessor abstractions. Do not adopt it if you need a standardised wire protocol that non-Java peers already speak, or if a thin Netty pipeline is enough for your traffic. Verify first whether the built-in RPC protocol is what you want on the wire, and read the user handbook's basic communication model section before writing a processor. The last push to master was on 2026-08-26, so the code is current, but the README does not document rollback or upgrade procedures for the wire protocol.

Frequently asked questions

What is SOFABolt and what is it for?

SOFABolt is a Netty-based network communication framework developed at Ant Group. It is meant for middleware developers who want to build RPC, messaging, distributed transaction or config-centre products without repeatedly writing a communication layer.

How do I add SOFABolt to a Maven project?

Add com.alipay.sofa:bolt as a dependency in your pom.xml. The README shows the group and artifact in its Maven Central version badge but does not pin a version in prose, so take the current version from Maven Central.

Which invocation models does SOFABolt support?

The README lists four basic communication models: oneway, sync, future and callback. Timeout control, heartbeat and IDLE event handling are part of the remoting core and are available by default.

Can I use SOFABolt with a protocol of my own design?

Yes. The README describes a second usage mode where SOFABolt acts as a protocol framework: you reuse the communication models and interface definitions, then define your own Command types, command processors and codec processors.

Are there non-Java clients for SOFABolt?

The README links to separate implementations for node, python and cpp. They are sibling projects rather than generated clients from a shared protocol specification, so their completeness relative to the Java version is not stated.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. sofastack/sofa-bolt on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/sofastack-sofa-bolt.svg)](https://hysenlabs.com/projects/sofastack-sofa-bolt)