示例#1
0
        public void PublishRead(string queueName, API.DemoMessage message)
        {
            var body = message.ToByteArray();

            var properties = _channel.CreateBasicProperties();

            properties.Type = API.DemoMessage.Descriptor.Name;

            _channel.BasicPublish(exchange: "",
                                  routingKey: queueName,
                                  basicProperties: properties,
                                  body: body);
        }
示例#2
0
        public void Produce(API.DemoMessage message)
        {
            var body = message.ToByteArray();

            var properties = _channel.CreateBasicProperties();

            properties.Type = API.DemoMessage.Descriptor.Name;

            _channel.BasicPublish(exchange: "demo.write",
                                  routingKey: "single",
                                  basicProperties: properties,
                                  body: body);
        }