public void Publish(byte[] message) { using (var connection = MessageQueueConnection.GetConnection()) using (var channel = connection.CreateModel()) { channel.QueueBind(MessageQueueConfiguration.QueueName, MessageQueueConfiguration.ExchangeName, ""); channel.BasicPublish(MessageQueueConfiguration.ExchangeName, "", null, message); } }
public bool IsServerAvailable() { try { return(MessageQueueConnection.GetConnection().IsOpen); } catch (BrokerUnreachableException exception) { Log.Error(exception); return(false); } }
public RabbitMQClient(RabbitMQConfiguration messageQueueConfiguration) : this() { MessageQueueConnection = new MessageQueueConnection(messageQueueConfiguration); MessageQueueConfiguration = messageQueueConfiguration; }