Not receiving message in Client side (Signalr)

Sreeram Jayaram 0 Reputation points
2024-01-05T11:28:25.1566667+00:00
JavaScript ->

connection = new HubConnectionBuilder().withUrl((

connection.on("CampaignMessage", (message) => {
      this.showPopup(message);
    }),
Azure Function (Isolated worker-process) - c#

[Function(SenogInformation("Triggered message to {UserId}", pushNotificationMessage.User);

                    var messageArgument = JsonConvert.SerializeObject(new
                    {
                        pushNotificationMessage.Message,
                        pushNotificationMessage.ResponseEndpoint,
                    });

                    return new SignalRMessageAction(SignalRHub)
                    {
                        Arguments = new[] { messageArgument },
                        UserId = encodedUserId,
                    };
                }
                else
                {
                    this.logger.LogInformation("User {UserId} is offline", pushNotificationMessage.User);
                    this.logger.LogInformation("Storing message to saturation storage");

                    pushNotificationMessage.ExpiryTime = DateTime.UtcNow.AddDays(Convert.ToInt32(this.pushNotificationOptions.Value.MessageExpirationTimeInDays));

                    await this.pushNoticationService.DeliverMessageWhenUserConnectedAsync(pushNotificationMessage);

                    return new SignalRMessageAction(SignalRHub);
                }
            }
            catch (Exception ex)
            {
                this.logger.LogError(ex, ex.Message);
                throw;
            }
        }

Here I'm trying to send message from server side to client side using signalr (Isolated process), but I'm not receiving any message in client side, after sending message to the hub from server side

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,070 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
146 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.