Conjecture.Messaging
0.27.1
See the version list below for details.
dotnet add package Conjecture.Messaging --version 0.27.1
NuGet\Install-Package Conjecture.Messaging -Version 0.27.1
<PackageReference Include="Conjecture.Messaging" Version="0.27.1" />
<PackageVersion Include="Conjecture.Messaging" Version="0.27.1" />
<PackageReference Include="Conjecture.Messaging" />
paket add Conjecture.Messaging --version 0.27.1
#r "nuget: Conjecture.Messaging, 0.27.1"
#:package Conjecture.Messaging@0.27.1
#addin nuget:?package=Conjecture.Messaging&version=0.27.1
#tool nuget:?package=Conjecture.Messaging&version=0.27.1
Conjecture.Messaging
Transport-agnostic messaging primitives for Conjecture. Defines MessageInteraction (queue/topic, body, headers, message-id, correlation-id), IMessageBusTarget (publish, receive, ack, reject), and an in-memory implementation for unit tests. Adapter packages — Conjecture.Messaging.AzureServiceBus, Conjecture.Messaging.RabbitMq — plug real brokers into the same model.
Install
dotnet add package Conjecture.Core
dotnet add package Conjecture.Messaging
Usage
using Conjecture.Core;
using Conjecture.Messaging;
InMemoryMessageBusTarget bus = new();
Strategy<MessageInteraction> publishes = Generate.Messaging
.Publish("orders", Generate.Bytes(0, 256));
await bus.ExecuteAsync(publishes.Sample(), CancellationToken.None);
MessageInteraction? received = await bus.ReceiveAsync(
"orders",
timeout: TimeSpan.FromSeconds(1),
CancellationToken.None);
if (received is not null)
{
await bus.AcknowledgeAsync(received, CancellationToken.None);
}
Use Generate.Messaging.Consume(queue) to model the receive side, and compose with InteractionStateMachine<TState> for stateful tests across publish/consume cycles.
Types
| Type | Role |
|---|---|
MessageInteraction |
Readonly record: destination, body, headers, message id, correlation id. |
IMessageBusTarget |
Publish, receive, acknowledge, reject. |
InMemoryMessageBusTarget |
In-process implementation for unit tests. |
Generate.Messaging.Publish(dest, body) |
Strategy of MessageInteraction representing a publish. |
Generate.Messaging.Consume(dest) |
Strategy of MessageInteraction representing a consume. |
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Conjecture.Core (>= 0.27.1)
- Conjecture.Interactions (>= 0.27.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Conjecture.Messaging:
| Package | Downloads |
|---|---|
|
Conjecture.Messaging.RabbitMq
RabbitMQ adapter for Conjecture messaging property tests. |
|
|
Conjecture.Messaging.AzureServiceBus
Azure Service Bus adapter for Conjecture messaging property tests. |
GitHub repositories
This package is not used by any popular GitHub repositories.