Sidub.Messaging.Host.SignalR
1.0.8
Prefix Reserved
dotnet add package Sidub.Messaging.Host.SignalR --version 1.0.8
NuGet\Install-Package Sidub.Messaging.Host.SignalR -Version 1.0.8
<PackageReference Include="Sidub.Messaging.Host.SignalR" Version="1.0.8" />
paket add Sidub.Messaging.Host.SignalR --version 1.0.8
#r "nuget: Sidub.Messaging.Host.SignalR, 1.0.8"
// Install Sidub.Messaging.Host.SignalR as a Cake Addin #addin nuget:?package=Sidub.Messaging.Host.SignalR&version=1.0.8 // Install Sidub.Messaging.Host.SignalR as a Cake Tool #tool nuget:?package=Sidub.Messaging.Host.SignalR&version=1.0.8
Sidub Messaging - Messaging SignalR Host
This repository contains the messaging SignalR host for Sidub Messaging. It provides functionality to facilitate the messaging implementation on an Azure serverless SignalR service.
Azure serverless SignalR consists of an isolated Azure Function and an Azure SignalR service in serverless mode. The Azure Function is responsible for negotiation between clients and defining the messaging hubs, while the Azure SignalR service is responsible for managing the connections and broadcasting messages.
This package supports the creation of the creation of messaging hubs within the isolated Azure Function.
Main Concepts
Infrastructure
The Azure SignalR messaging service is dependent upon Azure infrastructure; while infrastructure may be manually created, it is recommended to use the provided Sidub Messaging application available on the Azure Marketplace. By deploying this application, the necessary Azure SignalR, Function, Storage, and other resources will be created automatically.
See https://azuremarketplace.microsoft.com/ for more information.
Function initialization
In order to utilize the library functionality, we must register the required
services within the Azure Function. This is done by calling the
AddSidubSignalRServer
method on the IFunctionsWorkerApplicationBuilder
object.
We must additionally configure the required options classes, such as the
MessageServerOptions
and AuthenticationOptions
classes. These classes
contain the necessary configuration for the messaging service and the
authentication service, respectively.
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults((context, builder) =>
{
builder.Services.Configure<MessageServerOptions>(context.Configuration.GetSection(nameof(MessageServerOptions)));
builder.AddSidubSignalRServer();
})
.ConfigureServices((context, services) =>
{
services.Configure<AuthenticationOptions>(context.Configuration.GetSection(nameof(AuthenticationOptions)));
services.AddApplicationInsightsTelemetryWorkerService();
services.ConfigureFunctionsApplicationInsights();
})
.Build();
host.Run();
Messaging hub
A messaging hub is a C# class that defines a messaging endpoint. Multiple endpoints can be defined within a single Azure Function.
To define a messaging hub, simply inherit from the MessagingHub
class and
decorate the class with the MessagingHubAttribute
attribute. The attribute
requires a unique name for the hub.
[MessagingHub("Chatroom")]
public class ChatroomHub : MessagingHub
{
public ChatroomHub(IOptionsSnapshot<MessageServerOptions> options, IMessagingHubConnectionStore connectionStore, ILoggerFactory loggerFactory)
: base(options, connectionStore, loggerFactory)
{
}
}
License
This project is licensed under a proprietary license. For details, see https://sidub.ca/licensing or the LICENSE.txt file.
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. |
-
net8.0
- Microsoft.Azure.Functions.Worker.Extensions.Http (>= 3.2.0)
- Microsoft.Azure.Functions.Worker.Extensions.SignalRService (>= 1.14.1)
- Microsoft.Azure.SignalR.Management (>= 1.28.0)
- Microsoft.SourceLink.AzureRepos.Git (>= 8.0.0)
- Sidub.Messaging (>= 1.1.8)
- Sidub.Platform.Authentication.IsolatedFunction (>= 1.1.8)
- Sidub.Platform.Authorization.IsolatedFunction (>= 1.2.4)
- Sidub.Platform.Core (>= 1.9.10)
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.8 | 97 | 10/2/2024 |