Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Service lifecycle

A service (org.apache.camel.Service) in Camel adheres to the following lifecycle states as illustrated in the diagram below:

...

Notice: A service can optimally support suspend/resume by the org.apache.camel.SuspendableService. This means not all services in Camel supports suspension. It's encouraged that consumers support suspension which allows to suspend/resume routes.

Tip
extend ServiceSupport
extend ServiceSupport

The org.apache.camel.impl.ServiceSupport is a good base class to extend for custom services as it offers the basic functionally to keep track of state. You implement your custom logic in the doStart, doStop, doSuspend, doResume methods.

Routes lifecycle

Routes in Camel have the following operations to control its lifecycle

...