Apache.NMS.ActiveMQ.Session.CreateProducer C# (CSharp) Method

CreateProducer() public method

public CreateProducer ( IDestination destination ) : IMessageProducer
destination IDestination
return IMessageProducer
        public IMessageProducer CreateProducer(IDestination destination)
        {
            MessageProducer producer = null;

            try
            {
                ActiveMQDestination dest = null;
                if(destination != null)
                {
                    dest = ActiveMQDestination.Transform(destination);
                }

                producer = new MessageProducer(this, GetNextProducerId(), dest, this.RequestTimeout);

                producer.ProducerTransformer = this.ProducerTransformer;

                this.AddProducer(producer);
                this.Connection.Oneway(producer.ProducerInfo);
            }
            catch(Exception)
            {
                if(producer != null)
                {
                    this.RemoveProducer(producer.ProducerId);
                    producer.Close();
                }

                throw;
            }

            return producer;
        }

Same methods

Session::CreateProducer ( ) : IMessageProducer