static void DoIt(RebusTransportConfigurer configurer, string inputQueueName, string errorQueueName) { if (string.IsNullOrEmpty(inputQueueName)) { throw new ConfigurationErrorsException("You need to specify an input queue."); } var msmqMessageQueue = new MsmqMessageQueue(inputQueueName); // since these operations only make sense to perform on a local queue, we'll skip it if the error queue is remote // (read http://blogs.msdn.com/b/johnbreakwell/archive/2008/07/31/checking-if-msmq-queues-exist-is-hard-work-so-should-you-bother.aspx // for more info...) if (MsmqUtil.IsLocal(errorQueueName)) { var errorQueuePath = MsmqUtil.GetPath(errorQueueName); MsmqUtil.EnsureMessageQueueExists(errorQueuePath); MsmqUtil.EnsureMessageQueueIsTransactional(errorQueuePath); } configurer.UseSender(msmqMessageQueue); configurer.UseReceiver(msmqMessageQueue); configurer.UseErrorTracker(new ErrorTracker(errorQueueName)); }