Apache ServiceMix console

Now that we successfully installed and started Apache ServiceMix, we'll take a closer look at the console. This is where you manage your ServiceMix instance, add and remove bundles, install optional features, ...

Working with bundles

When ServiceMix is first started, a whole set of bundles providing the core features for the product are being installed. Let's use the command console to find out more about them...

The bundle:list command can be used to get a list of all bundles currently installed. Enter this

karaf@root> bundle:list

This is what the output looks like if you run this on your ServiceMix instance.

!/quickstart/images/osgi-list.png

|title=osgi:list!

For every bundle, you see:

  • the bundle id

  • the bundle state

  • if the bundle contains a Blueprint or Spring XML file, the next 2 columns will show you if the beans defined there were created successfully

  • the bundle start level

  • the bundle name and version

If you're looking for something specific in the list, you can use unix-like pipes and utilities to help you. An example: to look for all Camel related bundles...

karaf@root> bundle:list | grep camel

!/quickstart/images/osgi-list-pipegrep.png

|title=osgi:list!

Working with logging

Many of the applications you write will have some form of log output. To look at the message in the log file, you can us the log:diplay command.

karaf@root> log:display

!/quickstart/images/log-display.png

|title=log:display!

If you're only interested in the latest exception in the log file, you can use log:display-exception instead.

karaf@root> log:display-exception

!/quickstart/images/log-display-exception.png

|title=log:display-exception!

You can also change the log level at runtime by using the log:set command. You can try these commands on your instance now by first setting the log level to DEBUG and then using grep to make sure that you can actually see the extra logging.

karaf@root> log:set DEBUG
karaf@root> log:display | grep DEBUG

!/quickstart/images/log-set-debug.png

|title=log:set DEBUG!

Afterwards, revert the log level to its original INFO value again with log:set.

karaf@root> log:set INFO

...and there's a lot more

These are obviously just a few examples of what the command shell is all about. There are a lot more commands in the shell to help you deploy, monitor, manage and troubleshoot the applications you're building with ServiceMix.