ServiceMix Runtime

At the core of ServiceMix 4.x is the small and lightweight OSGi based runtime. This provides a small lightweight container onto which various bundles can be deployed.

The directory layout of the ServiceMix Runtime is as follows

servicemix/
 bin/   
  servicemix.sh    # shell scripts to boot up SMX 
  servicemix.bat 
  wrapper/         # Java Service Wrapper binaries
 
 system/           # the system defined OSGi bundles (i.e. the stuff shipped in the distro) which generally shouldn't be edited by users

 deploy/           # where bundles should be put to be hot-deployed - in jar or expanded format (the latter is good to let folks edit spring.xml files etc)
     
 etc/              # some config files for describing which OSGi container to use; also a text file to be able to describe the maven repos & mvn bundles to deploy

 data/             # directory used to store transient data (logs, activemq journal, transaction log, embedded DB, generated bundles)
  logs/
  generated-bundles/
  activemq/

Hot Deployment

To hot-deploy any OSGi bundles, just drop them into the deploy/ directory. Currently the hot deployment supports

  • OSGi bundles (*.jar)
  • OSGi configuration files (*.cfg)
  • expanded OSGi bundles (so that the contents can be edited directly forcing a reload).

Expanded OSGi bundles

The idea behind expanded OSGi bundles is that you can create an OSGi bundle using directories (rather than a jar) so that you can edit the Spring XML files or other configuration files or Java code in development mode. Then when you change the code, the ServiceMix Runtime will auto-detect this change, stop the previous bundle and redeploy your bundle.

This is great for working with Spring XML files or Camel Routes in a RAD way; so you can edit things in your IDE and the ServiceMix Runtime will automatically redeploy them.

Console

The runtime comes with a shell console that you can use to launch several commands. For a list of available commands, just run help.

See the Quick Start Guide for an example on how to start applications via the console.

Provisioning through OBR

In addition to the deploy/ folder, you can use OBR (OSGi Bundle Repository) through the shell console to deploy additional bundles.
See OBR for more information.

Download

You can grab a download of the minimum ServiceMix 4 Runtime here.

You can then use OBR to install new bundles via typing this into the console...

obr/start org.apache.servicemix.bundles.jaxb-impl camel-spring camel-example-osgi

Source

You can grab the source code here

In particular the core runtime lives here

  • No labels