コード例 #1
0
        protected NmsMessageConsumer(NmsConsumerId consumerId, NmsSession session, IDestination destination, string name, string selector, bool noLocal)
        {
            Session             = session;
            acknowledgementMode = session.AcknowledgementMode;

            if (destination.IsTemporary)
            {
                session.Connection.CheckConsumeFromTemporaryDestination((NmsTemporaryDestination)destination);
            }

            Info = new NmsConsumerInfo(consumerId)
            {
                Destination        = destination,
                Selector           = selector,
                NoLocal            = noLocal,
                SubscriptionName   = name,
                LocalMessageExpiry = Session.Connection.ConnectionInfo.LocalMessageExpiry,
                IsDurable          = IsDurableSubscription
            };
            deliveryTask = new MessageDeliveryTask(this);

            Session.Connection.CreateResource(Info).ConfigureAwait(false).GetAwaiter().GetResult();


            Session.Add(this);

            if (Session.IsStarted)
            {
                Start();
            }
        }
コード例 #2
0
        public NmsMessageConsumer(Id consumerId, NmsSession session, IDestination destination, string name, string selector, bool noLocal)
        {
            Session             = session;
            acknowledgementMode = session.AcknowledgementMode;

            if (destination.IsTemporary)
            {
                session.Connection.CheckConsumeFromTemporaryDestination((NmsTemporaryDestination)destination);
            }

            Info = new ConsumerInfo(consumerId, Session.SessionInfo.Id)
            {
                Destination        = destination,
                Selector           = selector,
                NoLocal            = noLocal,
                SubscriptionName   = name,
                LocalMessageExpiry = Session.Connection.ConnectionInfo.LocalMessageExpiry
            };
            deliveryTask = new MessageDeliveryTask(this);

            if (Session.IsStarted)
            {
                Start();
            }
        }
コード例 #3
0
        protected NmsMessageConsumer(NmsConsumerId consumerId, NmsSession session, IDestination destination, string name, string selector, bool noLocal)
        {
            Session             = session;
            acknowledgementMode = session.AcknowledgementMode;

            if (destination.IsTemporary)
            {
                session.Connection.CheckConsumeFromTemporaryDestination((NmsTemporaryDestination)destination);
            }

            Info = new NmsConsumerInfo(consumerId)
            {
                Destination        = destination,
                Selector           = selector,
                NoLocal            = noLocal,
                IsExplicitClientId = Session.Connection.ConnectionInfo.IsExplicitClientId,
                SubscriptionName   = name,
                IsShared           = IsSharedSubscription,
                IsDurable          = IsDurableSubscription,
                IsBrowser          = IsBrowser,
                LocalMessageExpiry = Session.Connection.ConnectionInfo.LocalMessageExpiry
            };
            deliveryTask = new MessageDeliveryTask(this);
        }