Ridvay.Azure.ServiceBus.Client.Abstractions
5.0.5.6
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Ridvay.Azure.ServiceBus.Client.Abstractions --version 5.0.5.6
NuGet\Install-Package Ridvay.Azure.ServiceBus.Client.Abstractions -Version 5.0.5.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ridvay.Azure.ServiceBus.Client.Abstractions" Version="5.0.5.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ridvay.Azure.ServiceBus.Client.Abstractions --version 5.0.5.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Ridvay.Azure.ServiceBus.Client.Abstractions, 5.0.5.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Ridvay.Azure.ServiceBus.Client.Abstractions as a Cake Addin #addin nuget:?package=Ridvay.Azure.ServiceBus.Client.Abstractions&version=5.0.5.6 // Install Ridvay.Azure.ServiceBus.Client.Abstractions as a Cake Tool #tool nuget:?package=Ridvay.Azure.ServiceBus.Client.Abstractions&version=5.0.5.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Ridvay.Azure.ServiceBus.Client
Simple POCO/DTO driven Azure Service Bus client
Install the package
Install the Ridvay.Azure.ServiceBus.Client library for .NET with NuGet:
dotnet add package Ridvay.Azure.ServiceBus.Client
Register services
using Ridvay.Azure.ServiceBus.Client;
public void ConfigureServices(IServiceCollection services)
{
services
//Register the Azure Service Bus client
.AddServiceBusClient(Configuration.GetConnectionString("ServiceBus"))
//Register message consumers
.AddConsumer<MyMessageConsumer>()
.AddConsumer<MyMessageConsumerWithReturn>()
;
};
Mesage Consumers Implemention
Void message consumer
public class MyMessageConsumer : IMessageConsumer<MyBasicMessage>
{
public Task ConsumeAsync(IMessageContext<MyBasicMessage> context)
{
//Do something with the message
return Task.CompletedTask;
}
}
Message with reply consumer
public class MyMessageConsumerWithReturn : IMessageConsumerWithReturn<MyMessage, MyReturnMessage>
{
public MyReturnMessage ConsumeAsync(IMessageContext<MyMessage> context)
{
//Do something with the message
return new MyReturnMessage();
}
}
Send Messages
using Ridvay.Azure.ServiceBus.Client;
public class MyClass
{
private readonly IMessageSender _sender;
public MyClass(IMessageSender sender)
{
_sender = sender;
}
// Send a message
public async Task SendMessage()
{
await _sender.SendAsync(new MyBasicMessage());
}
//Send a message with reply
public async Task<MyReturnMessage> SendMessageWithReply()
{
return await _sender.GetAsync<MyMessage, MyReturnMessage>(new MyMessage());
}
// Send a scheduled message
public async Task ScheduledSendAsync()
{
await _sender.ScheduleSendAsync(new MyBasicMessage(), DateTime.UtcNow.AddMinutes(15));
}
}
Message configuration
// Default configuration
public class MyBasicMessage
{
}
// Custom configuration
[QueueConsumer(QueueName= "SomeQueueName", MaxConcurrentCalls = 50, PrefetchCount = 100, AutoCompleteMessages = false)]
public class MyMessage
{
}
Messages with manual auto completion
public class MyMessageConsumerNoAutoComplete : IMessageConsumerWithReturn<MyMessageAutoComplete>
{
public async Task ConsumeAsync(IMessageContext<MyMessage> context)
{
// complete the message manually
await context.CompleteMessageAsync();
// abandon the message
await context.AbandonMessageAsync();
}
}
[QueueConsumer(AutoCompleteMessages = false)]
public class MyMessageAutoComplete
{
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Ridvay.Azure.ServiceBus.Client.Abstractions:
Package | Downloads |
---|---|
Ridvay.Azure.ServiceBus.Client
POCO/DTO driven Azure ServiceBus client |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
6.0.1.1 | 371 | 4/22/2023 |
5.0.5.6 | 457 | 1/28/2023 |
5.0.1-beta | 244 | 5/27/2022 |
5.0.0-beta | 190 | 5/24/2022 |