Search⌘ K
AI Features

Preparing to Run Multiple Hub Instances via Redis Backplane (II)

Explore how to prepare SignalR hubs for scaling by creating a reusable class library and hosting multiple ASP.NET Core apps that share hubs via Redis backplane. Learn project setup, package management, and hub endpoint configuration for seamless multi-instance communication.

Moving SignalR Hub to a class library

The diagram shows how Redis server works with SignalR applications.

Using Redis with SignalR
Using Redis with SignalR

Step 1: Create a class library project

Inside our LearningSignalR solution folder, we'll create a class library project by executing the following command:

dotnet new classlib -o SignalRHubs

Step 2: Add the project to solution

Once the project has been created, we will add it to the solution by executing the following command:

dotnet sln add SignalRHubs\SignalRHubs.csproj

Step 3: Install the required NuGet packages

Next, we will open the terminal inside SignalRHubs project folder and will install the required NuGet packages by executing the following commands:

dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer
dotnet add package
...