BridgingIT.DevKit.Infrastructure.Azure.ServiceBus 3.0.3-preview.0.25

This is a prerelease version of BridgingIT.DevKit.Infrastructure.Azure.ServiceBus.
There is a newer version of this package available.
See the version list below for details.
dotnet add package BridgingIT.DevKit.Infrastructure.Azure.ServiceBus --version 3.0.3-preview.0.25                
NuGet\Install-Package BridgingIT.DevKit.Infrastructure.Azure.ServiceBus -Version 3.0.3-preview.0.25                
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="BridgingIT.DevKit.Infrastructure.Azure.ServiceBus" Version="3.0.3-preview.0.25" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BridgingIT.DevKit.Infrastructure.Azure.ServiceBus --version 3.0.3-preview.0.25                
#r "nuget: BridgingIT.DevKit.Infrastructure.Azure.ServiceBus, 3.0.3-preview.0.25"                
#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 BridgingIT.DevKit.Infrastructure.Azure.ServiceBus as a Cake Addin
#addin nuget:?package=BridgingIT.DevKit.Infrastructure.Azure.ServiceBus&version=3.0.3-preview.0.25&prerelease

// Install BridgingIT.DevKit.Infrastructure.Azure.ServiceBus as a Cake Tool
#tool nuget:?package=BridgingIT.DevKit.Infrastructure.Azure.ServiceBus&version=3.0.3-preview.0.25&prerelease                

bITDevKit

Empowering developers with modular components for modern application development, centered around Domain-Driven Design principles.

Our goal is to empower developers by offering modular components that can be easily integrated into your projects. Whether you're working with repositories, commands, queries, or other components, the bITDevKit provides flexible solutions that can adapt to your specific needs.

This repository includes the complete source code for the bITDevKit, along with a variety of sample applications located in the ./examples folder within the solution. These samples serve as practical demonstrations of how to leverage the capabilities of the bITDevKit in real-world scenarios. All components are available as nuget packages.

For the latest updates and release notes, please refer to the RELEASES.

Join us in advancing the world of software development with the bITDevKit!

Azure Service Bus Messaging (Broker implementation)

Getting Stared: https://azuresdkdocs.blob.core.windows.net/$web/dotnet/Azure.Messaging.ServiceBus/7.14.0/index.html Research: https://chat.openai.com/share/90316478-d295-4c7b-9e8f-4861ca39097e

Topics are useful in publish/subscribe scenarios. alternate text is missing from this package README image

*** standard tier is necessary to use topics

Sending (Sender per topic):

  • use ServiceBusClient to communicate with Azure Service Bus
  • create a sender to send messages to a topic (messagename)
    await using var client = new ServiceBusClient(connectionString);
    ServiceBusSender sender = client.CreateSender(topicName);
    await sender.SendMessageAsync(message);
  • topic needs to be created on the fly (ManagementClient)
    ManagementClient managementClient = new ManagementClient(connectionString);
    TopicDescription topicDescription = await managementClient.GetTopicAsync(topicName);

Receiving (Processor per topic):

    var processor = client.CreateProcessor(topicName, subscriptionName);

when the number of topics is undefined (onsubscribe), you can dynamically create and register multiple processors for each topic

using Azure.Messaging.ServiceBus;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        string connectionString = "<your-connection-string>";
        List<string> topicNames = GetTopicNames(); // Get a list of topic names dynamically

        // Create the ServiceBusClient
        ServiceBusClient serviceBusClient = new ServiceBusClient(connectionString);

        try
        {
            List<ServiceBusProcessor> processors = new List<ServiceBusProcessor>();

            // Create and register a processor for each topic
            foreach (string topicName in topicNames)
            {
                ServiceBusProcessor processor = serviceBusClient.CreateProcessor(topicName, subscriptionName);

                processor.ProcessMessageAsync += async args =>
                {
                    var message = args.Message;
                    try
                    {
                        // Process the message here
                        Console.WriteLine($"Received message from topic '{topicName}': {message.Body}");

                        // Complete the message to remove it from the subscription
                        await args.CompleteMessageAsync(message);
                    }
                    catch (Exception ex)
                    {
                        // Handle any exceptions that occur during message processing
                        Console.WriteLine($"Error processing message: {ex}");
                        await args.AbandonMessageAsync(message);
                    }
                };

                processors.Add(processor);
                await processor.StartProcessingAsync();
            }

            Console.WriteLine("Receiving messages... Press any key to stop.");
            Console.ReadKey();

            // Stop processing messages and close the processors
            foreach (var processor in processors)
            {
                await processor.StopProcessingAsync();
                await processor.CloseAsync();
            }
        }
        catch (Exception ex)
        {
            // Handle any exceptions
            Console.WriteLine($"Exception: {ex.Message}");
        }
        finally
        {
            // Close the ServiceBusClient
            await serviceBusClient.DisposeAsync();
        }
    }

    static List<string> GetTopicNames()
    {
        // Implement the logic to dynamically fetch the topic names
        // For example, retrieve topic names from a configuration source or a data store
        // and return them as a list
        List<string> topicNames = new List<string>();
        // Add your logic to populate the topicNames list
        return topicNames;
    }
}

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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
3.0.4-preview.0.31 36 11/25/2024
3.0.4-preview.0.30 32 11/25/2024
3.0.4-preview.0.29 35 11/21/2024
3.0.4-preview.0.28 30 11/19/2024
3.0.4-preview.0.27 32 11/19/2024
3.0.4-preview.0.23 29 11/19/2024
3.0.4-preview.0.21 29 11/19/2024
3.0.4-preview.0.20 30 11/18/2024
3.0.4-preview.0.19 31 11/18/2024
3.0.4-preview.0.18 27 11/18/2024
3.0.4-preview.0.17 32 11/18/2024
3.0.4-preview.0.16 34 11/15/2024
3.0.4-preview.0.15 31 11/15/2024
3.0.4-preview.0.14 40 11/2/2024
3.0.4-preview.0.13 40 10/29/2024
3.0.4-preview.0.12 38 10/29/2024
3.0.4-preview.0.8 40 10/29/2024
3.0.4-preview.0.7 39 10/29/2024
3.0.4-preview.0.6 34 10/24/2024
3.0.4-preview.0.5 35 10/23/2024
3.0.4-preview.0.4 34 10/23/2024
3.0.4-preview.0.3 36 10/23/2024
3.0.4-preview.0.2 35 10/23/2024
3.0.4-preview.0.1 43 10/16/2024
3.0.3 89 10/11/2024
3.0.3-preview.0.56 44 10/10/2024
3.0.3-preview.0.55 38 10/10/2024
3.0.3-preview.0.54 43 10/10/2024
3.0.3-preview.0.50 41 10/10/2024
3.0.3-preview.0.49 45 10/9/2024
3.0.3-preview.0.44 46 10/8/2024
3.0.3-preview.0.43 41 10/8/2024
3.0.3-preview.0.42 40 10/7/2024
3.0.3-preview.0.41 40 10/7/2024
3.0.3-preview.0.40 46 10/1/2024
3.0.3-preview.0.39 47 10/1/2024
3.0.3-preview.0.38 45 10/1/2024
3.0.3-preview.0.36 46 9/30/2024
3.0.3-preview.0.35 42 9/26/2024
3.0.3-preview.0.34 46 9/26/2024
3.0.3-preview.0.33 48 9/26/2024
3.0.3-preview.0.32 50 9/24/2024
3.0.3-preview.0.31 49 9/10/2024
3.0.3-preview.0.30 45 9/9/2024
3.0.3-preview.0.29 46 9/9/2024
3.0.3-preview.0.28 39 9/8/2024
3.0.3-preview.0.27 57 9/5/2024
3.0.3-preview.0.26 53 9/3/2024
3.0.3-preview.0.25 47 9/3/2024
3.0.3-preview.0.24 52 9/3/2024
3.0.3-preview.0.23 69 8/21/2024
3.0.3-preview.0.22 36 7/29/2024
3.0.3-preview.0.21 53 7/25/2024
3.0.3-preview.0.18 55 7/12/2024
3.0.3-preview.0.17 46 7/12/2024
3.0.3-preview.0.16 41 7/12/2024
3.0.3-preview.0.15 41 7/5/2024
3.0.3-preview.0.14 56 6/24/2024
3.0.3-preview.0.13 54 6/23/2024
3.0.3-preview.0.12 57 6/21/2024
3.0.3-preview.0.11 57 6/20/2024
3.0.3-preview.0.9 55 5/27/2024
3.0.3-preview.0.8 58 5/27/2024
3.0.3-preview.0.7 61 5/17/2024
3.0.3-preview.0.6 56 5/14/2024
3.0.3-preview.0.5 59 5/8/2024
3.0.3-preview.0.3 68 5/6/2024
3.0.3-preview.0.1 60 4/25/2024
3.0.2 110 4/25/2024
3.0.2-preview.0.4 59 4/25/2024
3.0.2-preview.0.3 60 4/25/2024
3.0.2-preview.0.2 65 4/25/2024
3.0.2-preview.0.1 56 4/25/2024
3.0.1 118 4/25/2024
3.0.1-preview.0.10 62 4/24/2024
3.0.1-preview.0.9 45 4/19/2024
3.0.1-preview.0.8 53 4/24/2024
3.0.1-preview.0.7 53 4/24/2024

## Release 3.0.1 [25.04.24]

- [N] Initial release

-----
- [N] New
- [M] Modified
- [B] Breaking