/// <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); } }
/// <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 = (Apache.NMS.EMS.Message)message; this.tibcoMessageProducer.Send( msg.tibcoMessage, EMSConvert.ToMessageDeliveryMode(deliveryMode), (int)priority, (long)timeToLive.TotalMilliseconds); }
/// <summary> /// Sends the message to the default destination with the explicit QoS configuration /// </summary> public void Send(Apache.NMS.IMessage message, bool persistent, byte priority, TimeSpan timeToLive) { Apache.NMS.EMS.Message msg = (Apache.NMS.EMS.Message)message; this.tibcoMessageProducer.Send( msg.tibcoMessage, EMSConvert.ToMessageDeliveryMode(persistent), priority, (long)timeToLive.TotalMilliseconds); }
private Apache.NMS.EMS.Message GetEMSMessage(Apache.NMS.IMessage message) { Apache.NMS.EMS.Message msg = (Apache.NMS.EMS.Message)message; if (this.ProducerTransformer != null) { IMessage transformed = this.ProducerTransformer(this.nmsSession, this, message); if (transformed != null) { msg = (Apache.NMS.EMS.Message)transformed; } } return(msg); }
/// <summary> /// Sends the message to the default destination for this producer /// </summary> public void Send(Apache.NMS.IMessage message) { 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( msg.tibcoMessage, this.tibcoMessageProducer.MsgDeliveryMode, this.tibcoMessageProducer.Priority, timeToLive); }
/// <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); } }
/// <summary> /// Method DequeueNoWait /// </summary> public Apache.NMS.IMessage DequeueNoWait() { Apache.NMS.EMS.Message rc = null; lock (semaphore) { if (!m_bClosed && queue.Count > 0) { rc = (Apache.NMS.EMS.Message)queue.Dequeue(); if (null != rc) { rc.ReadOnlyBody = true; rc.ReadOnlyProperties = true; } } } return(rc); }