Beispiel #1
0
 public void RemoveConsumer(MessageConsumer consumer)
 {
     if (!this.closing)
     {
         consumers.Remove(consumer.ConsumerId);
     }
 }
Beispiel #2
0
 public void AddConsumer(MessageConsumer consumer)
 {
     if (!this.closing)
     {
         // Registered with Connection before we register at the broker.
         consumers[consumer.ConsumerId] = consumer;
     }
 }
Beispiel #3
0
        public IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal)
        {
            if (destination == null)
            {
                throw new InvalidDestinationException("Cannot create a Consumer with a Null destination");
            }

            MessageConsumer consumer = null;

            try
            {
                Queue queue = new Queue(destination.ToString());
                consumer = DoCreateMessageConsumer(GetNextConsumerId(), queue, acknowledgementMode);

                consumer.ConsumerTransformer = this.ConsumerTransformer;

                this.AddConsumer(consumer);

                if (this.Connection.IsStarted)
                {
                    consumer.Start();
                }
            }
            catch (Exception)
            {
                if (consumer != null)
                {
                    this.RemoveConsumer(consumer);
                    consumer.Close();
                }

                throw;
            }

            return(consumer);
        }
Beispiel #4
0
 public void RemoveConsumer(MessageConsumer consumer)
 {
     if (!this.closing)
     {
         consumers.Remove(consumer.ConsumerId);
     }
 }
Beispiel #5
0
 public void AddConsumer(MessageConsumer consumer)
 {
     if (!this.closing)
     {
         // Registered with Connection before we register at the broker.
         consumers[consumer.ConsumerId] = consumer;
     }
 }