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

CreateBrowser() public method

public CreateBrowser ( IQueue queue, string selector ) : IQueueBrowser
queue IQueue
selector string
return IQueueBrowser
        public IQueueBrowser CreateBrowser(IQueue queue, string selector)
        {
            if(queue == null)
            {
                throw new InvalidDestinationException("Cannot create a Consumer with a Null destination");
            }

            ActiveMQDestination dest = ActiveMQDestination.Transform(queue);
            QueueBrowser browser = null;

            try
            {
                browser = new QueueBrowser(this, GetNextConsumerId(), dest, selector, this.DispatchAsync);
            }
            catch(Exception)
            {
                if(browser != null)
                {
                    browser.Close();
                }

                throw;
            }

            return browser;
        }

Same methods

Session::CreateBrowser ( IQueue queue ) : IQueueBrowser