High-performance async messaging library for .NET 10 / C# 14.
An alternative to MassTransit with a fundamentally different architecture: raw-first (no envelope by default), zero-copy pipeline, manual topology, and deterministic memory usage.
- Raw-first — default serializer produces raw JSON, no envelope. Envelope format is opt-in.
- Manual topology —
ConfigureConsumeTopology = falseby default. Auto-topology is opt-in. - Zero-copy pipeline —
IBufferWriter<byte>/ReadOnlySequence<byte>withArrayPool. Nobyte[]allocation per-message in hot paths. - Credit-based flow control — bounded channels, atomic inflight tracking, health alerts at 90% capacity.
- Familiar API — uses MassTransit naming conventions (
IBus,IConsumer<T>,ConsumeContext<T>) for easy migration.
| Package | Description |
|---|---|
BareWire.Abstractions |
Public interfaces, zero dependencies |
BareWire |
Core engine, pipeline, bus implementation |
BareWire.Serialization.Json |
JSON serializer (System.Text.Json) |
BareWire.Serialization.MsgPack |
MessagePack serializer (compact binary) |
BareWire.CloudEvents |
CloudEvents 1.0 envelope (binary + structured) |
BareWire.Transport.RabbitMQ |
RabbitMQ transport |
BareWire.Transport.Kafka |
Kafka transport |
BareWire.Transport.AzureServiceBus |
Azure Service Bus transport |
BareWire.Transport.AWS.SQS |
AWS SQS transport |
BareWire.Transport.Google.PubSub |
Google Pub/Sub transport |
BareWire.Saga |
SAGA state machine |
BareWire.Saga.Redis |
Redis SAGA persistence |
BareWire.Outbox |
Outbox/Inbox pattern |
BareWire.Observability |
OpenTelemetry integration |
BareWire.Testing |
In-memory test harness |
Each transport also ships a single-call bundle package —
BareWire.RabbitMQ,BareWire.Kafka,BareWire.AzureServiceBus,BareWire.AWS.SQS,BareWire.Google.PubSub— that registers the core and the transport in oneAddBareWireWith{Transport}call.
# Build
dotnet build BareWire.slnx
# All tests
dotnet test BareWire.slnx
# Unit tests only
dotnet test tests/BareWire.UnitTests/
# Benchmarks
dotnet run --project tests/BareWire.Benchmarks/ -c Release -- --filter '*Publish*'- < 768 B/msg publish allocation, < 256 B/msg consume allocation
- > 500K msgs/s publish throughput
- > 300K msgs/s consume throughput (in-memory transport)
- PublishRaw — constant 136 B regardless of payload size (100 B → 10 KB, no difference). Pre-serialized
ReadOnlyMemory<byte>is passed through without copying. - PublishTyped — ~544 B fixed overhead + serialized payload size. The serialization boundary copy (
.ToArray()inMessagePipeline.ProcessOutboundAsync) is architecturally required —OutboundMessagemust outlive the pooled writer scope. - Serialization (raw) — constant 448 B regardless of payload size.
PooledBufferWriterrents fromArrayPool<byte>.Shared, confirming ADR-003 zero-copy pipeline.
Full report: docs/articles/benchmark-report.md
MIT. See LICENSE.