Пример #1
0
        private void SetupRequestReply(INmsConnection connection, Destination destination, Func<MessageFactory, IMessage, IMessage> messageReceivedCallback, string selector = null)
        {
            this.session = connection.GetSession();

            this.consumer = (selector == null)
                ? this.session.CreateConsumer(destination.GetDestination(this.session))
                : session.CreateConsumer(destination.GetDestination(this.session), selector);

            this.consumer.Listener += new MessageListener(this.RequestReplyCallback);

            this.replyProducer = this.session.CreateProducer();
            this.replyProducer.DeliveryMode = MsgDeliveryMode.NonPersistent;

            this.isInitialized = true;
        }
Пример #2
0
        private void SetupRequestOnly(INmsConnection connection, Destination destination, Action<IMessage> messageReceivedCallback, string selector = null)
        {
            this.session = connection.GetSession();
            this.consumer = (selector == null)
                ? this.session.CreateConsumer(destination.GetDestination(this.session))
                : session.CreateConsumer(destination.GetDestination(this.session), selector);

            this.consumer.Listener += new MessageListener(this.RequestOnlyCallback);

            this.isInitialized = true;
        }