示例#1
0
 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);
         }
 }
示例#2
0
 public bool IsServerAvailable()
 {
     try
     {
         return(MessageQueueConnection.GetConnection().IsOpen);
     }
     catch (BrokerUnreachableException exception)
     {
         Log.Error(exception);
         return(false);
     }
 }
示例#3
0
 public RabbitMQClient(RabbitMQConfiguration messageQueueConfiguration) : this()
 {
     MessageQueueConnection    = new MessageQueueConnection(messageQueueConfiguration);
     MessageQueueConfiguration = messageQueueConfiguration;
 }
示例#4
0
 public RabbitMQClient(RabbitMQConfiguration messageQueueConfiguration) : this()
 {
     MessageQueueConnection = new MessageQueueConnection(messageQueueConfiguration); 
     MessageQueueConfiguration = messageQueueConfiguration;
 }