title: How to pause a Camel Quartz2 timer in a suspended route?
body: <p>The following unit test tries a quartz2 route that triggers each second:</p>
  
  <pre><code>import org.apache.camel.builder.RouteBuilder;
  import org.apache.camel.component.mock.MockEndpoint;
  import org.apache.camel.test.junit4.CamelTestSupport;
  import org.junit.Test;
  
  public class CamelQuartzTest extends CamelTestSupport {
      static private String routeId = "test-route";
  
      @Test
      public void testSuspendRoute() throws Exception {
          // arrange
          MockEndpoint mock = getMockEndpoint("mock:result");
  
          // act
          System.out.println("context.start()");
          context.start();
          Thread.sleep(2000);
          System.out.println(String.format("receivedCounter = %d", mock.getReceivedCounter()));
  
          System.out.println("context.startRoute()");
          context.startRoute(routeId);
          Thread.sleep(2000);
          System.out.println(String.format("receivedCounter = %d", mock.getReceivedCounter()));
  
          System.out.println("context.suspendRoute()");
          context.suspendRoute(routeId);
          Thread.sleep(2000);
          System.out.println(String.format("receivedCounter = %d", mock.getReceivedCounter()));
  
          System.out.println("context.resumeRoute()");
          context.resumeRoute(routeId);
          Thread.sleep(2000);
          System.out.println(String.format("receivedCounter = %d", mock.getReceivedCounter()));
  
          System.out.println("context.stop()");
          context.stop();
          System.out.println(String.format("receivedCounter = %d", mock.getReceivedCounter()));
  
          // assert
          assertEquals(4, mock.getReceivedCounter());
      }
  
      @Override
      protected RouteBuilder createRouteBuilder() {
          return new RouteBuilder() {
              public void configure() {
                  from("quartz2://testtimer?cron=0/1+*+*+?+*+*")
                  .autoStartup(false)
                  .routeId(routeId)
                  .setBody()
                  .simple("${header.triggerName}: ${header.fireTime}")
                  .to("mock:result", "stream:out");
              }
          };
      }
  }
  </code></pre>
  
  <p>Result output:</p>
  
  <pre><code>context.start()
  receivedCounter = 0
  context.startRoute()
  testtimer: Tue Oct 21 10:06:38 CEST 2014
  testtimer: Tue Oct 21 10:06:39 CEST 2014
  receivedCounter = 2
  context.suspendRoute()
  receivedCounter = 2
  context.resumeRoute()
  testtimer: Tue Oct 21 10:06:41 CEST 2014
  testtimer: Tue Oct 21 10:06:41 CEST 2014
  testtimer: Tue Oct 21 10:06:42 CEST 2014
  testtimer: Tue Oct 21 10:06:43 CEST 2014
  receivedCounter = 6
  context.stop()
  receivedCounter = 6
  </code></pre>
  
  <p>After resuming the route, the result shows 4 incoming triggers, while 2 were expected. Apparently, the quartz2 timer keeps firing while the route is suspended. How can I make quartz2 take a pause while the route is suspended?</p>