Exemplo n.º 1
0
        public void Dispatch(MessageDispatch dispatch)
        {
            try
            {
                MessageConsumer consumer = null;

                lock (this.consumers.SyncRoot)
                {
//                    if(this.consumers.Contains(dispatch.ConsumerId))
//                    {
//                        consumer = this.consumers[dispatch.ConsumerId] as MessageConsumer;
//                    }
                }

                // If the consumer is not available, just ignore the message.
                // Otherwise, dispatch the message to the consumer.
                if (consumer != null)
                {
                    consumer.Dispatch(dispatch);
                }
            }
            catch (Exception ex)
            {
                Tracer.DebugFormat("Caught Exception While Dispatching: {0}", ex.Message);
            }
        }
Exemplo n.º 2
0
 public void RemoveConsumer(MessageConsumer consumer)
 {
     //connection.RemoveDispatcher(consumer.ConsumerId);
     if (!this.closing)
     {
         consumers.Remove(consumer.ConsumerId);
     }
     connection.RemoveDispatcher(consumer);
 }
Exemplo n.º 3
0
        public void AddConsumer(MessageConsumer consumer)
        {
            if (!this.closing)
            {
                int id = consumer.ConsumerId;

                // Registered with Connection before we register at the broker.
                consumers[id] = consumer;
                //connection.AddDispatcher(id, this);
            }
        }
Exemplo n.º 4
0
        public IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal)
        {
            if (destination == null)
            {
                throw new InvalidDestinationException("Cannot create a Consumer with a Null destination");
            }

            MessageConsumer consumer = null;

            return(consumer);
        }