Conjecture.Messaging
0.29.0
dotnet add package Conjecture.Messaging --version 0.29.0
NuGet\Install-Package Conjecture.Messaging -Version 0.29.0
<PackageReference Include="Conjecture.Messaging" Version="0.29.0" />
<PackageVersion Include="Conjecture.Messaging" Version="0.29.0" />
<PackageReference Include="Conjecture.Messaging" />
paket add Conjecture.Messaging --version 0.29.0
#r "nuget: Conjecture.Messaging, 0.29.0"
#:package Conjecture.Messaging@0.29.0
#addin nuget:?package=Conjecture.Messaging&version=0.29.0
#tool nuget:?package=Conjecture.Messaging&version=0.29.0
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 = Strategy.Messaging
.Publish("orders", Strategy.Arrays(Strategy.Integers<byte>(), 0, 256).Select(static b => (ReadOnlyMemory<byte>)b));
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 Strategy.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. |
Strategy.Messaging.Publish(dest, body) |
Strategy of MessageInteraction representing a publish. |
Strategy.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.29.0)
- Conjecture.Interactions.Abstractions (>= 0.29.0)
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.