title: Clear queues on bus start or stop
body: <p>Is there a configuration setting on Rebus to clear out the queues on bus startup or shutdown? The reason I need to do this is I have two instances of Rebus running for my integration test, and if a test fails I don't want the failed message to get retried in the subsequent test run.</p>
  
  <p>Here is what I have for the integration test client that sends the messages. Note that RebusHost is just a wrapper around the system under test:</p>
  
  <pre><code>using Rebus.Configuration;
  using Rebus.Transports.Msmq;
  
  namespace MT.Testing.Integration
  {
      [TestClass]
      public class IntegrationTestFixture
      {
          private static IMtHost _host;
  
          [AssemblyInitialize]
          public static void IntegrationTestInitialize(TestContext testContext)
          {
              _host = new RebusHost();
  
              _host.Start();
          }
  
          [AssemblyCleanup]
          public static void IntegrationTestCleanup()
          {
              _host.Stop();
          }
  
          public static IBus GetClientBus(IContainerAdapter containerAdapter)
          {
              return Configure.With(containerAdapter)
                  .Transport(t =&gt; t.UseMsmq("mt.testing.integration.client.input", "mt.testing.integration.client.error"))
                  .MessageOwnership(d =&gt; d.Use(new IntegrationMessageOwnership()))
                  .Subscriptions(s =&gt; s.StoreInMemory())
                  .Sagas(s =&gt; s.StoreInMemory())
                  .CreateBus().Start();
          }
      }
  
      public class IntegrationMessageOwnership : IDetermineMessageOwnership
      {
          public string GetEndpointFor(Type messageType)
          {
              return "mt.testing.integration.input";
          }
      }
  }
  </code></pre>