Exemplo n.º 1
0
        /// <summary>
        /// 订阅消息
        /// </summary>
        /// <param name="topic">消息主题</param>
        /// <param name="group">消息分组</param>
        /// <param name="handler">消息处理器</param>
        public void Subscribe(string topic, string group, Func <ReadOnlyMemory <byte>, ulong, Task> handler)
        {
            var channel = channels.GetOrAdd(group, _rabbitMQClient.GetChannel());

            channel.Subscribe(topic, group, handler);
        }