예제 #1
0
 private void InnerSubscribeTopic(string topic)
 {
     if (!this.topics.ContainsKey(topic))
     {
         lock (topicsLocker) {
             if (!this.topics.ContainsKey(topic))
             {
                 RabbitMQUtils.DeclareExchange(topic, this.Channel.Value);
                 RabbitMQUtils.BindQueueToExchange(this.queueName, topic, this.Channel.Value);
                 this.topics[topic] = true;
             }
         }
     }
 }
예제 #2
0
 public void Publish(string topic, string message)
 {
     RabbitMQUtils.DeclareExchange(topic, channel.Value);
     RabbitMQUtils.Publish(topic, message, this.channel.Value);
 }