AddMessageConsumer() public method

Add a message consumer to monitor for messages received
public AddMessageConsumer ( IMessageConsumer consumer ) : void
consumer IMessageConsumer
return void
 /// <summary>
 /// open a consumer to the given endpoint.
 /// this method wont return until the cancellation token is cancelled
 /// </summary>
 /// <param name="session">session to connect to</param>
 /// <param name="topic">topic to get data from</param>
 /// <param name="appendedText">optional text to append to durable subscriber name</param>
 /// <param name="connectionMonitor">connection monitor that is monitoring this connection</param>
 /// <param name="listener">delegat to subecribe to new messages</param>
 /// <param name="ct">cancellation token to wait on once connected</param>
 private void OpenAndWaitConsumer(ISession session, ITopic topic, string appendedText, NMSConnectionMonitor connectionMonitor, MessageListener listener, CancellationToken ct)
 {
     using (IMessageConsumer consumer = CreateConsumer(session, topic, appendedText))
     {
         Trace.TraceInformation("Created consumer to {0}", topic);
         consumer.Listener += listener;
         connectionMonitor.AddMessageConsumer(consumer);
         ct.WaitHandle.WaitOne();
     }
 }