IntelliTect.AspNetCore.SignalR.SqlServer icon indicating copy to clipboard operation
IntelliTect.AspNetCore.SignalR.SqlServer copied to clipboard

Saving in database issue

Open HussamAbuHera opened this issue 1 year ago • 1 comments

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; });

HussamAbuHera avatar Jun 23 '24 12:06 HussamAbuHera

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.

ascott18 avatar Jun 24 '24 16:06 ascott18