public uint GetMessageCount() { using (var model = _connectionPool.GetConnection().CreateModel()) { return(GetMessageCount(model)); } }
public void Publish <T>(string exchangeName, string routingKey, T content) { var serializedContent = _serializer.Serialize(content); using (var model = _connectionPool.GetConnection().CreateModel()) { var props = model.CreateBasicProperties(); props.DeliveryMode = 2; var payload = Encoding.UTF8.GetBytes(serializedContent); model.BasicPublish(exchangeName, routingKey, props, payload); } }