Book Image

Apache Karaf Cookbook

By : Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler
Book Image

Apache Karaf Cookbook

By: Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler

Overview of this book

Table of Contents (17 chapters)
Apache Karaf Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Starting and stopping Camel Contexts in Karaf


Starting and stopping the bundle that contains a Camel Context can be very clumsy; you can use the camel:context-start and camel:context-stop commands to manage specific contexts.

Getting ready

Follow the instructions under the Listing Camel Contexts in Karaf recipe's Getting ready section for this recipe.

How to do it…

Managing Camel Contexts in Karaf is easy, but requires you to become familiar with two commands, which are as follows:

  • camel:context-start contextName: This command is used to start a context

  • camel:context-stop contextName: This command is used to stop a context

The following Camel command invocations demonstrate the result of stopping a context:

karaf@root()> camel:context-list
 Context               Status         Uptime         
 -------               ------         ------         
 CamelCommandContext   Started        3.139 seconds  
karaf@root()> camel:context-stop CamelCommandContext 
karaf@root()> camel:context-list...