Uniphar.ServiceBus.Extensions
2.4.1
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
<PackageReference Include="Uniphar.ServiceBus.Extensions" Version="2.4.1" />
<PackageVersion Include="Uniphar.ServiceBus.Extensions" Version="2.4.1" />
<PackageReference Include="Uniphar.ServiceBus.Extensions" />
paket add Uniphar.ServiceBus.Extensions --version 2.4.1
#r "nuget: Uniphar.ServiceBus.Extensions, 2.4.1"
#:package Uniphar.ServiceBus.Extensions@2.4.1
#addin nuget:?package=Uniphar.ServiceBus.Extensions&version=2.4.1
#tool nuget:?package=Uniphar.ServiceBus.Extensions&version=2.4.1
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 | Versions 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. |
-
net8.0
- Azure.Messaging.ServiceBus (>= 7.18.4)
- Microsoft.Extensions.Options (>= 9.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.