Example #1
0
 public MessageConsumer(Session session, int consumerId, Destination dest, AcknowledgementMode acknowledgementMode)
 {
     this.session = session;
     this.id = consumerId;
     this.destination = dest;
     this.acknowledgementMode = acknowledgementMode;
 }
Example #2
0
        public void Start()
        {
            // Don't try creating receiver if session not yet up
            if (!session.IsStarted)
            {
                throw new SessionClosedException();
            }

            if (started.CompareAndSet(false, true))
            {
                try
                {
                    // Create qpid receiver
                    Tracer.DebugFormat("Start Consumer Id = " + ConsumerId.ToString());
                    if (qpidReceiver == null)
                    {
                        qpidReceiver = session.CreateQpidReceiver(destination.Address);
                        // Recover replyTo address from qpid receiver and set as the
                        // replyTo destination for received messages.
                        Address replyTo = qpidReceiver.GetAddress();
                        if (destination.IsQueue)
                        {
                            Queue queue = new Queue(replyTo.Name, replyTo.Subject, replyTo.Options);
                            replyToDestination = (Destination)queue;
                        }
                        else if (destination.IsTopic)
                        {
                            Topic topic = new Topic(replyTo.Name, replyTo.Subject, replyTo.Options);
                            replyToDestination = (Destination)topic;
                        }
                    }
                }
                catch (Org.Apache.Qpid.Messaging.QpidException e)
                {
                    throw new NMSException("Failed to create Qpid Receiver : " + e.Message);
                }
            }
        }
Example #3
0
 protected Destination(Destination other)
 {
     qpidAddress = new Org.Apache.Qpid.Messaging.Address(other.Address);
 }
Example #4
0
 internal virtual MessageConsumer DoCreateMessageConsumer(int id, Destination destination, AcknowledgementMode mode)
 {
     return(new MessageConsumer(this, id, destination, mode));
 }
Example #5
0
 public MessageProducer(Session session, int producerId, Destination destination)
 {
     this.session = session;
     this.id = producerId;
     this.destination = destination;
 }
Example #6
0
 internal virtual MessageProducer DoCreateMessageProducer(Destination destination)
 {
     return(new MessageProducer(this, GetNextProducerId(), destination));
 }
Example #7
0
 public MessageProducer(Session session, int producerId, Destination destination)
 {
     this.session     = session;
     this.id          = producerId;
     this.destination = destination;
 }
Example #8
0
 protected Destination(Destination other)
 {
     qpidAddress = new Org.Apache.Qpid.Messaging.Address(other.Address);
 }
Example #9
0
 internal virtual MessageConsumer DoCreateMessageConsumer(int id, Destination destination, AcknowledgementMode mode)
 {
     return new MessageConsumer(this, id, destination, mode);
 }
Example #10
0
 internal virtual MessageProducer DoCreateMessageProducer(Destination destination)
 {
     return new MessageProducer(this, GetNextProducerId(), destination);
 }