Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor spelling and grammar changes

...

The default strategy will graceful shutdowns gracefully shutdown routes:

  • Camel 2.2: in the same order they was started
  • Camel 2.3: in the reverse order they was started. The option shutdownRoutesInReverseOrder can be used to use the old behavior.
  • let pending and current in flight exchanges run to completion before shutting down
  • using a timeout of 300 seconds which then forces a shutdown now

...

You can control two areas that influences influence graceful shutdown in the Camel routing:

...

Available as of Camel 2.3
Its now possible to graceful gracefully shutdown an individual route using shutdownRoute(routeId) method on CamelContext. Its also possible to provide a specific timeout to use instead of the default timeout settings using shutdownRoute(routeId, timeout, timeUnit).

...

When using Spring XML you then just define a spring bean which implements the org.apache.camel.spi.ShutdownStrategy and Camel will lookup look it up at startup and use it instead of its default. See more at Advanced configuration of CamelContext using Spring.

...

The interface org.apache.camel.spi.ShutdownAware is an optional interface consumers can implement to have fine grained control during shutdown. The ShutdownStrategy must be able to deal with consumers which implements implement this interface. This interface was introduced to cater for in memory consumers such as SEDA which potentially have a number of pending messages on its internal in memory queues. What this allows is to let it control the shutdown process to let it complete its pending messages.

...

Batch Consumer should implement ShutdownAware so they properly supports support the ShutdownRunningTask option. See for example GenericFileConsumer for an example.

...