public MessageConsumer(Session session, int consumerId, Destination dest, AcknowledgementMode acknowledgementMode) { this.session = session; this.id = consumerId; this.destination = dest; this.acknowledgementMode = acknowledgementMode; }
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); } } }
protected Destination(Destination other) { qpidAddress = new Org.Apache.Qpid.Messaging.Address(other.Address); }
internal virtual MessageConsumer DoCreateMessageConsumer(int id, Destination destination, AcknowledgementMode mode) { return(new MessageConsumer(this, id, destination, mode)); }
public MessageProducer(Session session, int producerId, Destination destination) { this.session = session; this.id = producerId; this.destination = destination; }
internal virtual MessageProducer DoCreateMessageProducer(Destination destination) { return(new MessageProducer(this, GetNextProducerId(), destination)); }
internal virtual MessageConsumer DoCreateMessageConsumer(int id, Destination destination, AcknowledgementMode mode) { return new MessageConsumer(this, id, destination, mode); }
internal virtual MessageProducer DoCreateMessageProducer(Destination destination) { return new MessageProducer(this, GetNextProducerId(), destination); }