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; } } } }
public void Publish(string topic, string message) { RabbitMQUtils.DeclareExchange(topic, channel.Value); RabbitMQUtils.Publish(topic, message, this.channel.Value); }