IntelliTect / IntelliTect.AspNetCore.SignalR.SqlServer

A Microsoft SQL Server backplane for ASP.NET Core SignalR.
Apache License 2.0
36 stars 5 forks source link

Saving in database issue #17

Open HussamAbuHera opened 2 months ago

HussamAbuHera commented 2 months ago

when I am using this statement to send messages to client side to specific connection ids :

await _chatHubContext.Clients.Clients(connectionsIds).SendMessageToAgent(message);

it's not saving any data in the database

but when use this will all : await _chatHubContext.Clients.All.SendMessageToAgent(message);

it's saving data in the database, why this issue and how to solve it, here is my configuration : services.AddSignalR() .AddSqlServer(options => { options.ConnectionString = Configuration.GetConnectionString("DefaultConnection"); options.AutoInstallSchema = true;
options.AutoEnableServiceBroker = true; }) .AddJsonProtocol(options => { options.PayloadSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; });

ascott18 commented 2 months ago

This is intended - messages directed to a specific connection, if that connection is connected to the server that is sending the message, are sent directly to that connection and do not need to transit through the database.