Exemple #1
0
        /// <summary>
        /// Creates a new connection to TIBCO.
        /// </summary>
        public Apache.NMS.IConnection CreateConnection(string userName, string password)
        {
            Apache.NMS.IConnection connection = null;

            try
            {
                connection = EMSConvert.ToNMSConnection(this.tibcoConnectionFactory.CreateConnection(userName, password));
                ConfigureConnection(connection);
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
            }

            return(connection);
        }
Exemple #2
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
            {
                Apache.NMS.IMessageConsumer consumer = EMSConvert.ToNMSMessageConsumer(this, this.tibcoSession.CreateConsumer(destinationObj.tibcoDestination, selector, noLocal));
                ConfigureConsumer(consumer);
                return(consumer);
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
                return(null);
            }
        }
Exemple #3
0
        public Apache.NMS.IMessageConsumer CreateDurableConsumer(Apache.NMS.ITopic destination, string name, string selector, bool noLocal)
        {
            Apache.NMS.EMS.Topic topicObj = (Apache.NMS.EMS.Topic)destination;

            try
            {
                Apache.NMS.IMessageConsumer consumer = EMSConvert.ToNMSMessageConsumer(this, this.tibcoSession.CreateDurableSubscriber(topicObj.tibcoTopic, name, selector, noLocal));
                ConfigureConsumer(consumer);
                return(consumer);
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
                return(null);
            }
        }
Exemple #4
0
        public Apache.NMS.IMessageProducer CreateProducer(Apache.NMS.IDestination destination)
        {
            Apache.NMS.EMS.Destination destinationObj = (Apache.NMS.EMS.Destination)destination;

            try
            {
                Apache.NMS.IMessageProducer producer = EMSConvert.ToNMSMessageProducer(this, this.tibcoSession.CreateProducer(destinationObj.tibcoDestination));
                ConfigureProducer(producer);
                return(producer);
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
                return(null);
            }
        }
Exemple #5
0
        /// <summary>
        /// Creates a new connection to TIBCO.
        /// </summary>
        public Apache.NMS.IConnection CreateConnection(string userName, string password)
        {
            Apache.NMS.IConnection connection = null;

            try
            {
                connection = EMSConvert.ToNMSConnection(this.tibcoConnectionFactory.CreateConnection(userName, password));
                connection.RedeliveryPolicy = this.redeliveryPolicy.Clone() as IRedeliveryPolicy;
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
            }

            return(connection);
        }
Exemple #6
0
        /// <summary>
        /// Sends the message to the default destination with the explicit QoS configuration
        /// </summary>
        public void Send(Apache.NMS.IMessage message, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
        {
            Apache.NMS.EMS.Message msg = GetEMSMessage(message);

            try
            {
                this.tibcoMessageProducer.Send(
                    msg.tibcoMessage,
                    EMSConvert.ToMessageDeliveryMode(deliveryMode),
                    (int)priority,
                    (long)timeToLive.TotalMilliseconds);
            }
            catch (Exception ex)
            {
                ExceptionUtil.WrapAndThrowNMSException(ex);
            }
        }
Exemple #7
0
        private void HandleTibcoMsg(object sender, TIBCO.EMS.EMSMessageEventArgs arg)
        {
            Apache.NMS.IMessage message = EMSConvert.ToNMSMessage(arg.Message);

            if (null != message)
            {
                if (Listener != null)
                {
                    try
                    {
                        Listener(message);
                    }
                    catch (Exception ex)
                    {
                        Apache.NMS.Tracer.Debug("Error handling message: " + ex.Message);
                    }
                }
                else
                {
                    this.dispatcher.Enqueue(message);
                }
            }
        }
Exemple #8
0
 public Apache.NMS.IBytesMessage CreateBytesMessage()
 {
     return(EMSConvert.ToNMSBytesMessage(this.tibcoSession.CreateBytesMessage()));
 }
Exemple #9
0
 public Apache.NMS.ITemporaryQueue CreateTemporaryQueue()
 {
     return(EMSConvert.ToNMSTemporaryQueue(this.tibcoSession.CreateTemporaryQueue()));
 }
Exemple #10
0
 public Apache.NMS.ITopic GetTopic(string name)
 {
     return(EMSConvert.ToNMSTopic(this.tibcoSession.CreateTopic(name)));
 }
Exemple #11
0
 public Apache.NMS.IQueue GetQueue(string name)
 {
     return(EMSConvert.ToNMSQueue(this.tibcoSession.CreateQueue(name)));
 }
Exemple #12
0
        public Apache.NMS.IMessageConsumer CreateDurableConsumer(Apache.NMS.ITopic destination, string name, string selector, bool noLocal)
        {
            Apache.NMS.EMS.Topic topicObj = (Apache.NMS.EMS.Topic)destination;

            return(EMSConvert.ToNMSMessageConsumer(this, this.tibcoSession.CreateDurableSubscriber(topicObj.tibcoTopic, name, selector, noLocal)));
        }
Exemple #13
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)));
        }
Exemple #14
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)));
        }
Exemple #15
0
 /// <summary>
 /// Creates a new connection to TIBCO.
 /// </summary>
 public Apache.NMS.IConnection CreateConnection(string userName, string password)
 {
     return(EMSConvert.ToNMSConnection(this.tibcoConnectionFactory.CreateConnection(userName, password)));
 }
Exemple #16
0
 public Apache.NMS.IMapMessage CreateMapMessage()
 {
     return(EMSConvert.ToNMSMapMessage(this.tibcoSession.CreateMapMessage()));
 }
Exemple #17
0
 public Apache.NMS.ITextMessage CreateTextMessage(string text)
 {
     return(EMSConvert.ToNMSTextMessage(this.tibcoSession.CreateTextMessage(text)));
 }
Exemple #18
0
 public Apache.NMS.ITemporaryTopic CreateTemporaryTopic()
 {
     return(EMSConvert.ToNMSTemporaryTopic(this.tibcoSession.CreateTemporaryTopic()));
 }
Exemple #19
0
 /// <summary>
 /// Creates a new connection to TIBCO.
 /// </summary>
 public Apache.NMS.IConnection CreateConnection()
 {
     return(EMSConvert.ToNMSConnection(this.tibcoConnectionFactory.CreateConnection()));
 }
Exemple #20
0
 public Apache.NMS.IObjectMessage CreateObjectMessage(Object body)
 {
     return(EMSConvert.ToNMSObjectMessage(this.tibcoSession.CreateObjectMessage(body)));
 }