public void SendData() { var factory = new ConnectionFactory() { HostName = _host }; using (var connection = factory.CreateConnection()) { using (var channel = connection.CreateModel()) { channel.QueueDeclare(queue: _queue, durable: false, exclusive: false, autoDelete: false, arguments: null); var body = Encoding.UTF8.GetBytes(_message.Pack()); channel.BasicPublish(exchange: "", routingKey: _queue, basicProperties: null, body: body); } } }