protected void RegisterDurableConsumer(string connectionID, string destination, string consumerID, string selector, bool noLocal)
{
using(IConnection connection = CreateConnection(connectionID))
{
connection.Start();
using(ISession session = connection.CreateSession(AcknowledgementMode.DupsOkAcknowledge))
{
ITopic destinationTopic = SessionUtil.GetTopic(session, destination);
Assert.IsNotNull(destinationTopic, "Could not get destination topic.");
using(IMessageConsumer consumer = session.CreateDurableConsumer(destinationTopic, consumerID, selector, noLocal))
{
Assert.IsNotNull(consumer, "Could not create durable consumer.");
}
}
}
}