Inheritance: BaseCommand
        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);
            }
        }
Exemple #2
0
		public ProducerState(ProducerInfo info)
		{
			this.info = info;
		}
Exemple #3
0
		public void addProducer(ProducerInfo info)
		{
			checkShutdown();
			producers.Add(info.ProducerId, new ProducerState(info));
		}
 public override Response processAddProducer(ProducerInfo info)
 {
     if(info != null && info.ProducerId != null)
     {
         SessionId sessionId = info.ProducerId.ParentId;
         if(sessionId != null)
         {
             ConnectionId connectionId = sessionId.ParentId;
             if(connectionId != null)
             {
                 ConnectionState cs = connectionStates[connectionId];
                 if(cs != null)
                 {
                     SessionState ss = cs[sessionId];
                     if(ss != null)
                     {
                         ss.addProducer(info);
                     }
                 }
             }
         }
     }
     return TRACKED_RESPONSE_MARKER;
 }
 public virtual Response processAddProducer(ProducerInfo info)
 {
     return null;
 }
		protected void disposeOf(ITransport transport, ProducerInfo producer)
		{
			transport.Oneway(new RemoveInfo() { ObjectId = producer.ProducerId });
		}