Alschy.QueueWorker.Azure.ServiceBus 1.0.0

dotnet add package Alschy.QueueWorker.Azure.ServiceBus --version 1.0.0
NuGet\Install-Package Alschy.QueueWorker.Azure.ServiceBus -Version 1.0.0
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="Alschy.QueueWorker.Azure.ServiceBus" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Alschy.QueueWorker.Azure.ServiceBus --version 1.0.0
#r "nuget: Alschy.QueueWorker.Azure.ServiceBus, 1.0.0"
#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 Alschy.QueueWorker.Azure.ServiceBus as a Cake Addin
#addin nuget:?package=Alschy.QueueWorker.Azure.ServiceBus&version=1.0.0

// Install Alschy.QueueWorker.Azure.ServiceBus as a Cake Tool
#tool nuget:?package=Alschy.QueueWorker.Azure.ServiceBus&version=1.0.0

QueueWorker.Azure.ServiceBus

A simple, tiny and specialized library for creating microservices they should consume Azure Service Bus messages.

For who is the library written?

For all they would implement in a stright forward manner, microservice they should listen on Azure Service Bus Messages and would easy implement the business logic than archtitectural and technical boilerplate code.

For who is the library NOT wirtten

  • For all they would use other message brokers than Azure Service Bus. Sorry, it would not be happen in this library.
  • For all they love her own architecture and wanna have full control over the archtecture and the message processing.
  • For all overengineers.

STS approach

  • S → Simple. No complicated options and boilerplate code requiered to use it (it should reduce the code that you must be write)
  • T → Tiny. No much classes, no much options, a very limited use case. Thats the recipe for a library that is fast, small, maintainable and understoodable. It's contain only three classes including the one extension class for the Microsoft DI system.
  • S → Specilized. Specialized for a limited set of use cases, in practise I use in one project one technology for multiple business cases, they could implemented by a single technology. There are a lot reasons to support multiple message brokers, like in a product. But there a allways the customer individual projects, where you have the possibility to choose only one message broker.

How to use it?

NICE, that you ask 😉

  1. Install the nuget package.
  2. Add a class in which you would process your messages and implement the interface IDataProcessor implement the two methods from the interface:
  • ProcessMessageAsync returns a Task for asyncronusly operations. Became a ProcessMessageEventArgs parameter which is representing the Azure Service Bus message.
  • ProcessErrorAsync returns a Task too, for same reasons. Became a ProcessErrorEventArgs parameter who containes the error of the message processing. would be generated from the Azure Service Bus client library.
  1. Go to your Programm.cs and build your hosting system (for now only the Microsoft DI library is direct supported, but technically you can use othe IoC libraries, i think). 3.1. Add to a configured ServiceBusClient to the IoC. For simple reasons you can use the AddServiceBusClient(string? connectionString) method if you want. If you wanna to managed identiies or othe authentication methods then you can easily do your stuff in your code. 3.1. Now the interssting part 😃 Call AddDataQueueProcessor<TProcessor>(string queueName) TProcessor must be your data processor you have implemented in step 2. What would be do this? First its register your data processor to the IoC, then a hosted service would be created. To build th hosted service, its receive the ServiceBusClient from the IoC, get from this a queue processor with your desired queue name and then create a new QueueReceiverJob with the type of your processor.
  2. Lean back and implement your business logic.
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. 
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.0 6,844 11/12/2022