Obvs 7.0.0
dotnet add package Obvs --version 7.0.0
NuGet\Install-Package Obvs -Version 7.0.0
<PackageReference Include="Obvs" Version="7.0.0" />
<PackageVersion Include="Obvs" Version="7.0.0" />
<PackageReference Include="Obvs" />
paket add Obvs --version 7.0.0
#r "nuget: Obvs, 7.0.0"
#:package Obvs@7.0.0
#addin nuget:?package=Obvs&version=7.0.0
#tool nuget:?package=Obvs&version=7.0.0
Obvs
Messaging between .NET services. Each service has commands, events, requests and responses. You choose its transport: RabbitMQ, Kafka, NATS, ActiveMQ, Azure Service Bus, Amazon SQS or NetMQ, each in its own package. Your code handles its messages, or reads them as Reactive Extensions streams.
This package has the bus, hosting with AddObvs, handlers, System.Text.Json serialization, OpenTelemetry, the analyzers and the [ObvsMessages] source generator.
dotnet add package Obvs
dotnet add package Obvs.RabbitMQ
Define your service's messages:
// Every message of a service implements its interface, and is one of ICommand, IEvent, IRequest or IResponse.
// A request names the response that answers it.
public interface IOrderMessage : IMessage { }
public record PlaceOrder(string OrderId) : IOrderMessage, ICommand;
public record OrderPlaced(string OrderId) : IOrderMessage, IEvent;
public record GetQuote(string Sku) : IOrderMessage, IRequest<Quote>
{
public string RequestId { get; set; }
public string RequesterId { get; set; }
}
public record Quote(string Sku, decimal Price) : IOrderMessage, IResponse
{
public string RequestId { get; set; }
public string RequesterId { get; set; }
}
Host the service: it handles commands and requests, and publishes events.
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddObvs(obvs => obvs
.AddService<IOrderMessage>("orders", service => service
.UseRabbitMq(options => options.Uri = new Uri("amqp://localhost:5672"))
.HandleCommand<PlaceOrder>(async (command, context, ct) =>
{
// ... place the order, then tell whoever's interested
await context.PublishAsync(new OrderPlaced(command.OrderId), ct);
})
.HandleRequest<GetQuote, Quote>((request, context, ct) =>
Task.FromResult(new Quote(request.Sku, 9.99m)))));
await builder.Build().RunAsync();
Then send it commands and requests from another app, a client of the service:
var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddObvs(obvs => obvs
.AddService<IOrderMessage>("orders", service => service
.UseRabbitMq(options => options.Uri = new Uri("amqp://localhost:5672"))
.AsClient()));
using var app = builder.Build();
await app.StartAsync();
var client = app.Services.GetRequiredService<IServiceBusClient>();
await client.SendAsync(new PlaceOrder("o-1"));
var quote = await client.RequestAsync(new GetQuote("sku-1"), TimeSpan.FromSeconds(5));
Next steps
- The README, and the Obvs site.
- Common tasks: add a service, handle and send messages, requests, errors, tests, tracing.
- Configuration errors and analyzers.
- Migrating from v6.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.14)
- Microsoft.Bcl.TimeProvider (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.14)
- System.Diagnostics.DiagnosticSource (>= 10.0.14)
- System.Reactive (>= 7.0.0)
- System.Text.Json (>= 10.0.14)
- System.Threading.Channels (>= 10.0.14)
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.14)
- Microsoft.Bcl.TimeProvider (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.DependencyModel (>= 10.0.14)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.14)
- System.Diagnostics.DiagnosticSource (>= 10.0.14)
- System.Reactive (>= 7.0.0)
- System.Text.Json (>= 10.0.14)
- System.Threading.Channels (>= 10.0.14)
-
net10.0
- Microsoft.Extensions.DependencyInjection (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.DependencyModel (>= 10.0.14)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.14)
- System.Reactive (>= 7.0.0)
NuGet packages (28)
Showing the top 5 NuGet packages that depend on Obvs:
| Package | Downloads |
|---|---|
|
Obvs.ActiveMQ
ActiveMQ transport for Obvs: UseActiveMq(...). |
|
|
Obvs.Serialization.Json
Newtonsoft.Json serialization for Obvs, for services that need Newtonsoft's settings or converters. Without it, Obvs serializes with System.Text.Json, to the same JSON. |
|
|
Obvs.Serialization.MessagePack-CSharp
MessagePack-CSharp (https://github.com/neuecc/MessagePack-CSharp) serialization for Obvs |
|
|
Obvs.Serialization.ProtoBuf
protobuf-net serialization for Obvs: SerializedWith(new ProtoBufMessageSerializer(), ...). |
|
|
Obvs.Serialization.Xml
XML serialization for Obvs |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.0.0 | 72 | 11/12/2026 |
| 7.0.0-rc.1 | 66 | 11/11/2026 |
| 6.0.32 | 615 | 11/5/2026 |
| 6.0.31 | 695 | 10/25/2026 |
| 6.0.30 | 562 | 10/25/2026 |
| 6.0.29 | 574 | 10/25/2026 |
| 6.0.28 | 564 | 10/25/2026 |
| 6.0.27 | 560 | 10/25/2026 |
| 6.0.26 | 556 | 10/25/2026 |
| 6.0.25 | 575 | 10/25/2026 |
| 6.0.24 | 559 | 10/25/2026 |
| 6.0.23 | 559 | 10/25/2026 |
| 6.0.22 | 591 | 10/25/2026 |
| 6.0.21 | 602 | 10/25/2026 |
| 6.0.20 | 605 | 10/25/2026 |
| 6.0.19 | 566 | 10/25/2026 |
| 6.0.18 | 581 | 10/25/2026 |
| 6.0.17 | 568 | 10/25/2026 |
| 6.0.16 | 600 | 10/25/2026 |
| 6.0.10 | 21,174 | 11/17/2021 |
v7 adds hosting with dependency injection, handlers, RequestAsync, System.Text.Json, OpenTelemetry, Azure Service Bus and Amazon SQS. Migrating from v6: https://github.com/christopherread/Obvs/blob/master/docs/migrating-from-v6.md