Пример #1
0
        /// <summary>
        /// Sends the message to the given destination
        /// </summary>
        public void Send(Apache.NMS.IDestination destination, Apache.NMS.IMessage message)
        {
            Apache.NMS.EMS.Destination dest = (Apache.NMS.EMS.Destination)destination;
            Apache.NMS.EMS.Message     msg  = GetEMSMessage(message);
            long timeToLive = (long)message.NMSTimeToLive.TotalMilliseconds;

            if (0 == timeToLive)
            {
                timeToLive = this.tibcoMessageProducer.TimeToLive;
            }

            try
            {
                this.tibcoMessageProducer.Send(
                    dest.tibcoDestination,
                    msg.tibcoMessage,
                    this.tibcoMessageProducer.MsgDeliveryMode,
                    this.tibcoMessageProducer.Priority,
                    timeToLive);
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
            }
        }
Пример #2
0
        /// <summary>
        /// Sends the message to the given destination with the explicit QoS configuration
        /// </summary>
        public void Send(Apache.NMS.IDestination destination, Apache.NMS.IMessage message,
                         MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
        {
            Apache.NMS.EMS.Destination dest = (Apache.NMS.EMS.Destination)destination;
            Apache.NMS.EMS.Message     msg  = (Apache.NMS.EMS.Message)message;

            this.tibcoMessageProducer.Send(
                dest.tibcoDestination,
                msg.tibcoMessage,
                EMSConvert.ToMessageDeliveryMode(deliveryMode),
                (int)priority,
                (long)timeToLive.TotalMilliseconds);
        }
Пример #3
0
        /// <summary>
        /// Sends the message to the given destination with the explicit QoS configuration
        /// </summary>
        public void Send(Apache.NMS.IDestination destination, Apache.NMS.IMessage message,
                         bool persistent, byte priority, TimeSpan timeToLive)
        {
            Apache.NMS.EMS.Destination dest = (Apache.NMS.EMS.Destination)destination;
            Apache.NMS.EMS.Message     msg  = (Apache.NMS.EMS.Message)message;

            this.tibcoMessageProducer.Send(
                dest.tibcoDestination,
                msg.tibcoMessage,
                EMSConvert.ToMessageDeliveryMode(persistent),
                priority,
                (long)timeToLive.TotalMilliseconds);
        }
Пример #4
0
        public Apache.NMS.IMessageConsumer CreateConsumer(Apache.NMS.IDestination destination, string selector, bool noLocal)
        {
            Apache.NMS.EMS.Destination destinationObj = (Apache.NMS.EMS.Destination)destination;

            try
            {
                return(EMSConvert.ToNMSMessageConsumer(this, this.tibcoSession.CreateConsumer(destinationObj.tibcoDestination, selector, noLocal)));
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
                return(null);
            }
        }
Пример #5
0
        public Apache.NMS.IMessageProducer CreateProducer(Apache.NMS.IDestination destination)
        {
            Apache.NMS.EMS.Destination destinationObj = (Apache.NMS.EMS.Destination)destination;

            try
            {
                return(EMSConvert.ToNMSMessageProducer(this, this.tibcoSession.CreateProducer(destinationObj.tibcoDestination)));
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
                return(null);
            }
        }
Пример #6
0
        public Apache.NMS.IMessageConsumer CreateConsumer(Apache.NMS.IDestination destination)
        {
            Apache.NMS.EMS.Destination destinationObj = (Apache.NMS.EMS.Destination)destination;

            try
            {
                Apache.NMS.IMessageConsumer consumer = EMSConvert.ToNMSMessageConsumer(this, this.tibcoSession.CreateConsumer(destinationObj.tibcoDestination));
                ConfigureConsumer(consumer);
                return(consumer);
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
                return(null);
            }
        }
Пример #7
0
        /// <summary>
        /// Sends the message to the given destination
        /// </summary>
        public void Send(Apache.NMS.IDestination destination, Apache.NMS.IMessage message)
        {
            Apache.NMS.EMS.Destination dest = (Apache.NMS.EMS.Destination)destination;
            Apache.NMS.EMS.Message     msg  = (Apache.NMS.EMS.Message)message;
            long timeToLive = (long)message.NMSTimeToLive.TotalMilliseconds;

            if (0 == timeToLive)
            {
                timeToLive = this.tibcoMessageProducer.TimeToLive;
            }

            this.tibcoMessageProducer.Send(
                dest.tibcoDestination,
                msg.tibcoMessage,
                this.tibcoMessageProducer.MsgDeliveryMode,
                this.tibcoMessageProducer.Priority,
                timeToLive);
        }
Пример #8
0
        /// <summary>
        /// Sends the message to the given destination with the explicit QoS configuration
        /// </summary>
        public void Send(Apache.NMS.IDestination destination, Apache.NMS.IMessage message,
                         MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
        {
            Apache.NMS.EMS.Destination dest = (Apache.NMS.EMS.Destination)destination;
            Apache.NMS.EMS.Message     msg  = GetEMSMessage(message);

            try
            {
                this.tibcoMessageProducer.Send(
                    dest.tibcoDestination,
                    msg.tibcoMessage,
                    EMSConvert.ToMessageDeliveryMode(deliveryMode),
                    (int)priority,
                    (long)timeToLive.TotalMilliseconds);
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
            }
        }
Пример #9
0
        public Apache.NMS.IMessageConsumer CreateConsumer(Apache.NMS.IDestination destination, string selector, bool noLocal)
        {
            Apache.NMS.EMS.Destination destinationObj = (Apache.NMS.EMS.Destination)destination;

            return(EMSConvert.ToNMSMessageConsumer(this, this.tibcoSession.CreateConsumer(destinationObj.tibcoDestination, selector, noLocal)));
        }
Пример #10
0
        public Apache.NMS.IMessageConsumer CreateConsumer(Apache.NMS.IDestination destination)
        {
            Apache.NMS.EMS.Destination destinationObj = (Apache.NMS.EMS.Destination)destination;

            return(EMSConvert.ToNMSMessageConsumer(this, this.tibcoSession.CreateConsumer(destinationObj.tibcoDestination)));
        }