Exemplo n.º 1
0
        private void ConsumerClient_OnMessage(object sender, Message <Null, string> e)
        {
            var message = new MessageContext
            {
                Group   = _groupId,
                Name    = e.Topic,
                Content = e.Value
            };

            OnMessageReceieved?.Invoke(sender, message);
        }
Exemplo n.º 2
0
        private void OnConsumerReceived(object sender, BasicDeliverEventArgs e)
        {
            _deliveryTag = e.DeliveryTag;
            var message = new MessageContext
            {
                Group   = _queueName,
                Name    = e.RoutingKey,
                Content = Encoding.UTF8.GetString(e.Body)
            };

            OnMessageReceieved?.Invoke(sender, message);
        }