Esempio n. 1
0
 /// <summary>
 /// 发送消息给组
 /// </summary>
 /// <param name="record">消息</param>
 /// <param name="Groups">组</param>
 public async Task Push(MessageRecord record, string[] Groups)
 {
     var eventDate = new RemoteEventTopicData("MQ.SignalR")
     {
         Data = new
         {
             Record = record,
             Groups = Groups
         },
         Topic = $"SignalR.{record.MsgType}"
     };
     await remoteEventBus.PublishAsync(eventDate);
 }
Esempio n. 2
0
        /// <summary>
        /// 发送消息到MQ,由MQ分发后再推送到客户端
        /// </summary>
        /// <param name="record">消息</param>
        /// <param name="Groups">组</param>
        public Task SendToRabbitMQAsync(MessageRecord record, string[] Groups)
        {
            var eventDate = new RemoteEventTopicData("MQ.SignalR")
            {
                Data = new
                {
                    Record = record,
                    Groups = Groups
                },
                Topic = $"SignalR.{record.MsgType}"
            };

            return(remoteEventBus.PublishAsync(eventDate));
        }