ServerTools.ServerCommands.AzureServiceBus 1.0.3.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package ServerTools.ServerCommands.AzureServiceBus --version 1.0.3.3
                    
NuGet\Install-Package ServerTools.ServerCommands.AzureServiceBus -Version 1.0.3.3
                    
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="ServerTools.ServerCommands.AzureServiceBus" Version="1.0.3.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ServerTools.ServerCommands.AzureServiceBus" Version="1.0.3.3" />
                    
Directory.Packages.props
<PackageReference Include="ServerTools.ServerCommands.AzureServiceBus" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ServerTools.ServerCommands.AzureServiceBus --version 1.0.3.3
                    
#r "nuget: ServerTools.ServerCommands.AzureServiceBus, 1.0.3.3"
                    
#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.
#:package ServerTools.ServerCommands.AzureServiceBus@1.0.3.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ServerTools.ServerCommands.AzureServiceBus&version=1.0.3.3
                    
Install as a Cake Addin
#tool nuget:?package=ServerTools.ServerCommands.AzureServiceBus&version=1.0.3.3
                    
Install as a Cake Tool

About

ServerCommands facilitates running of units of code or commands remotely. It incorporates principles of messaging architectures used by most messaging tools and frameworks, like Azure Service Bus, AWS SQS, RabbitMQ, or Azure Storage Queues, Apache Kafka without any of the knowledge and configuration expertise to manage such installations and configurations.

This library is a spcific implementation that uses Azure Service Bus. Other implementations are listed below. If you want to create your own extension skip to the section on How to create your own extension to this library.

Implementations

More documentation is available at the ServerCommands.

How to Use

To post a command:

 var c = await new CloudCommands().InitializeAsync(new CommandContainer(), new AzureServiceBusConnectionOptions(Environment.GetEnvironmentVariable["ASBConnectionString"], MaxDequeueCountForError: 3, Log: new DebugLoggerProvider().CreateLogger("default"), QueueNamePrefix: "intro"));

_ = await c.PostCommandAsync<AddNumbersCommand>(new { Number1 = 2, Number2 = 3 });
//or _ = await c.PostCommandAsync(typeof(AddNumbersCommand), new { Number1 = 2, Number2 = 3 });

To execute commands:

var _container = new CommandContainer();

_container
   .Use(logger)
   .RegisterCommand<AddNumbersCommand>()
   .RegisterResponse<AddNumbersCommand, AddNumbersResponse>();


var c = await new CloudCommands().InitializeAsync(_container, new AzureServiceBusConnectionOptions(Environment.GetEnvironmentVariable["ASBConnectionString"], MaxDequeueCountForError: 3, Log: new DebugLoggerProvider().CreateLogger("default"), QueueNamePrefix: "intro"));

var result = await c.ExecuteCommandsAsync()();

//check if something was wrong or if any items were processed at all
Assert.IsTrue(!result.Item1);

//check if 1 or more items were processed
Assert.IsTrue(result.Item2 > 0);

//check if there was any errors
Assert.IsTrue(result.Item3.Count > 0); //This value keeps the list of error messages that were encountered. After retrying 5 times the command is moved to the deadletterqueue.

If a command generates a response, than you also execute and responses:

var responses = commands.ExecuteResponsesAsync();

Assert.IsTrue(!responses.Item1);
Assert.IsTrue(responses.Item2 > 0);


And that's that!

For more detailed documentation and more complex use cases head to the offical documentation at the GitHub repo. If there are questions or request new feautures do not hesitate to post them there.

Key Features

  • Cross-usability between services
  • Cross-functionality between clouds or on-prem
  • Enhanced simplicity
  • Asynchroneous remote execution
  • Batching and correlation of commands
  • Commands with remote response execution
  • High performance
  • Supports .NET 5.0+

Feedback

ServerCommands is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5.1 455 8/21/2022
1.0.5 409 8/21/2022
1.0.4 461 7/6/2022
1.0.3.3 445 7/5/2022

Some release notes