Uniphar.ServiceBus.Extensions 2.4.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Uniphar.ServiceBus.Extensions --version 2.4.1
                    
NuGet\Install-Package Uniphar.ServiceBus.Extensions -Version 2.4.1
                    
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="Uniphar.ServiceBus.Extensions" Version="2.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Uniphar.ServiceBus.Extensions" Version="2.4.1" />
                    
Directory.Packages.props
<PackageReference Include="Uniphar.ServiceBus.Extensions" />
                    
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 Uniphar.ServiceBus.Extensions --version 2.4.1
                    
#r "nuget: Uniphar.ServiceBus.Extensions, 2.4.1"
                    
#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 Uniphar.ServiceBus.Extensions@2.4.1
                    
#: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=Uniphar.ServiceBus.Extensions&version=2.4.1
                    
Install as a Cake Addin
#tool nuget:?package=Uniphar.ServiceBus.Extensions&version=2.4.1
                    
Install as a Cake Tool

servicebus-extensions

NuGet package repository for ServiceBus Extensions

Purpose

The purpose of this component is to provide constant configuration support for configuration of service bus topic, subscription and senders.

Using the Configuration Options

The TopicOptions,SubscriberOptions,SenderOptions allow for multiple configurations to be defined in configuration and initialized at runtime.

TopicOption Configuration

"TopicOptions": {
  "Topics": [
    {
      "Name": "topic-name"
    }
  ]
}

The TopicOptions configuration element contains a list of Topic type configurations.

Each Topic configuration element has one required attribute and that is Name.

Each Topic has optional attributes that correspond to the properties of the CreateTopicOptions class. Therefore each CreateTopicOption property may be overridden from its default value.

For example the MaxSizeInMegabytes may be overridden from its default value of 1024.

"TopicOptions": {
  "Topics": [
    {
      "Name": "topic-name",
      "MaxSizeInMegabytes": 2048
    }
  ]
}

SubscriberOption Configuration

"SubscriberOptions": {
  "Subscriptions": [
    {
      "Name": "subscription-name",
    }
  ]
}

The SubscriberOptions configuration element contains a list of Subscriber type configurations.

Each Subscription configuration element has one required attribute and that is Name.

Each Topic has optional attributes that correspond to the properties of the CreateSubscriptionOptions class. Therefore each CreateSubscriptionOption property may be overridden from its default value.

For example the MaxDeliveryCount may be overridden from its default value of 10.

"SubscriberOptions": {
  "Subscriptions": [
    {
      "Name": "subscription-name",
      "MaxDeliveryCount": 20,
    }
  ]
}
Rules

Each Subscription configuration element can contains a set of rules that can be applied to the subscription. There are two types of rules that can be configured a SqlRule and a CorrelationRule. Therefore each CorrelationRule property may be overridden from its default value.

CorrelationRule
"SubscriberOptions": {
  "Subscriptions": [
    {
      "Name": "subscription-name",
      "MaxDeliveryCount": 20,
      "CorrelationRules": [
        {
            "Name": "CorrelationRule",
            "Subject ": "MessageSubject"
        }
      ]
    }
  ]
}

A CorrelationRule configuration type contains optional attributes that correspond to the properties of the CorrelationRuleFilter class.

Application Properties
"SubscriberOptions": {
  "Subscriptions": [
    {
      "Name": "subscription-name",
      "MaxDeliveryCount": 20,
      "CorrelationRules": [
        {
            "Name": "CorrelationRule",
            "Subject ": "MessageSubject",
            "ApplicationProperties": {
                "object_type": "ObjectType",
                "event_type": "Created"
            }
        }
      ]
    }
  ]
}

A CorrelationRule may also specify ApplicationProperties that are applied to the CorrelationRuleFilter. These attributes are key value pairs, defined as a dictionary.

SqlRule
"SubscriberOptions": {
  "Subscriptions": [
    {
      "Name": "subscription-name",
      "MaxDeliveryCount": 20,
      "SqlRules": [
        {
            "Name": "SqlRule",
            "Filter" : "color='blue' AND quantity=10",
            "Action": "SET quantity = quantity / 2;"
        }
      ]
    }
  ]
}

A SqlRule configuration type contains optional attributes that correspond to the properties of the SqlRuleFilter class.

The required attributes are Name and Filter the Action attribute is optional.

Any new rules added to the subscriber configuration options will be created on the subscription when the InitializeAsync extension method is invoked.

Note: Modifications or deletion of rules are currently not supported.

Processor
"Processor": {
  "ProcessingType": "Topic",
  "MaxConcurrentCalls": 10
}

Each Subscription configuration element can contains a configuration for a Processor. A processor defines the configuration settings for a ServiceBusProcessor. The Processor configuration type contains optional attributes that correspond to the properties of the ServiceBusProcessorOptions class.

The Processor ProcessingType must be set to either Topic Or Queue. This will be used during the initialization of the ServiceBusProcessor

Therefore each ServiceBusProcessorOptions property may be overridden from its default value.

For example the MaxConcurrentCalls may be overridden from its default value of 1.

"Processor": {
  "ProcessingType": "Topic",
  "MaxConcurrentCalls": 10
}

SenderOption Configuration

"SenderOptions": {
  "Senders": [
   {
    "Identifier": "identifier",
    "QueueOrTopicName": "queue-or-topic-name"
   }
  ]
}

The SenderOptions configuration element contains a list of Sender type configurations.

Each Sender configuration element has one required attribute and that is QueueOrTopicName.

Initializing Configuration

Initializing Topic Configuration

var topicOptions = ....;
var serviceBusAdministrationClient = new ServiceBusAdministrationClient(...);

topicOptions.InitializeAsync(serviceBusAdministrationClient);

Initializing Subscriber Configuration

var subscriberOptions = ....;
var serviceBusAdministrationClient = new ServiceBusAdministrationClient(...);

subscriberOptions.InitializeAsync(serviceBusAdministrationClient);

Initializing Processor Configuration

var subscription = .....;
var serviceBusClient = new ServiceBusClient(...);

ServiceBusProcessor serviceBusProcessor = subscription.InitializeProcessorAsync(serviceBusClient);

Initializing Sender Configuration

ServiceBusSender serviceBusSender = serviceBusClient.CreateSender(senderOptions.Value.Senders!.First().QueueOrTopicName, senderOptions.Value.Senders!.First().CreateServiceBusSenderOptions());
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.  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
2.8.0 1,395 8/28/2025
2.7.0 803 8/26/2025
2.6.0 473 8/19/2025
2.5.0 151 8/19/2025
2.4.2 6,633 4/8/2025
2.4.1 245 4/3/2025
2.4.0 473 3/31/2025
2.3.0 1,575 2/13/2025
2.2.0 352 2/7/2025
2.1.0 211 2/6/2025
2.0.0 136 2/5/2025
1.0.0 122 1/30/2025