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);
}
}