Apache.NMS.ActiveMQ.MessageProducer.MessageProducer C# (CSharp) Method

MessageProducer() public method

public MessageProducer ( Session session, ProducerId id, ActiveMQDestination destination, System.TimeSpan requestTimeout ) : System
session Session
id Apache.NMS.ActiveMQ.Commands.ProducerId
destination Apache.NMS.ActiveMQ.Commands.ActiveMQDestination
requestTimeout System.TimeSpan
return System
        public MessageProducer(Session session, ProducerId id, ActiveMQDestination destination, TimeSpan requestTimeout)
        {
            this.session = session;
            this.RequestTimeout = requestTimeout;

            this.info = new ProducerInfo();
            this.info.ProducerId = id;
            this.info.Destination = destination;
            this.info.WindowSize = session.Connection.ProducerWindowSize;

            this.messageTransformation = session.Connection.MessageTransformation;

            // If the destination contained a URI query, then use it to set public
            // properties on the ProducerInfo
            if(destination != null && destination.Options != null)
            {
                URISupport.SetProperties(this.info, destination.Options, "producer.");
            }

            // Version Three and higher will send us a ProducerAck, but only if we
            // have a set producer window size.
            if(session.Connection.ProtocolVersion >= 3 && this.info.WindowSize > 0)
            {
                Tracer.Debug("MessageProducer created with a Window Size of: " + this.info.WindowSize);
                this.usage = new MemoryUsage(this.info.WindowSize);
            }
        }