官术网_书友最值得收藏!

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
karaf@root()>

How it works…

The context commands operate on the Camel framework and do not represent the OSGi life cycle. Depending upon your application, a stopped context may result in the need to restart its host bundle.

See also

  • The Listing routes in Karaf recipe
主站蜘蛛池模板: 凤阳县| 阿城市| 武冈市| 昆明市| 普洱| 乌海市| 五华县| 科尔| 阳泉市| 瓦房店市| 甘谷县| 门头沟区| 高雄县| 宁晋县| 巩留县| 财经| 龙胜| 南昌市| 新民市| 呼伦贝尔市| 商丘市| 海阳市| 宜都市| 赣州市| 阳原县| 平果县| 长丰县| 山东| 永丰县| 农安县| 丰都县| 涟水县| 巴彦县| 宜宾县| 江西省| 岚皋县| 嵊泗县| 思南县| 柳河县| 宜黄县| 天气|