You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 132 Next »

4. Examples

The ServiceMix distribution comes with several examples categories. The following sections of this document will help you understanding the differences between these examples and explain alternative methods to start them

Here are the examples shipped with ServiceMix:

#top

Maven configuration

Unable to render {include} The included page could not be found.

JBI packaging using Maven

The following examples use the standard JBI packaging:

Deployment using maven

You will need a ServiceMix server running to deploy this assembly. From the distribution root directory, launch:

cd [servicemix_install_dir]
bin/servicemix

Using maven, you can launch the following command to build the Service Assembly:

cd [servicemix_install_dir]/examples/wsdl-first
mvn install

Then, you can deploy the Service Assembly along with the needed JBI components on an already started ServiceMix container:

cd [SM30UG:servicemix_install_dir]/examples/wsdl-first/wsdl-first-sa
mvn jbi:projectDeploy

Manual deployment

These examples comes with a pre-built service assembly that you can deploy manually.

First, start a ServiceMix server:

cd [servicemix_install_dir]
bin/servicemix

Install the needed components and shared libraries:

cd [servicemix_install_dir]/components
cp servicemix-shared* ../install
cp xxx* ../install

The servicemix-shared artifact is a shared library needed by all JBI components. After copying it, you can copy all the needed components to the install directory of ServiceMix.

From another console, launch the following commands:

cd [servicemix_install_dir]/examples/wsdl-first/wsdl-first-sa
cp xxx-sa-3.0-incubating.zip [servicemix_install_dir]/deploy

Ant deployment

You can also use the ant tasks to deploy the JBI artifacts:

cd [servicemix_install_dir]/components

ant -f ../ant/servicemix-ant-task.xml \
    -Dsm.username=smx \
    -Dsm.password=smx \
    -Dsm.install.file=servicemix-shared-3.0-incubating.zip
    install-shared-library

ant -f ../ant/servicemix-ant-task.xml \
    -Dsm.username=smx \
    -Dsm.password=smx \
    -Dsm.install.file=servicemix-http-3.0-incubating.zip
    install-component

ant -f ../ant/servicemix-ant-task.xml \
    -Dsm.username=smx \
    -Dsm.password=smx \
    -Dsm.component.name=servicemix-http \
    start-component

You need to launch the install-component and start-component tasks for each needed component.

Then, you can deploy the service assembly:

cd [servicemix_install_dir]/examples/wsdl-first/

ant -f ../../ant/servicemix-ant-task.xml \
    -Dsm.username=smx \
    -Dsm.password=smx \
    -Dsm.deploy.file=wsdl-first-sa-3.0-incubating.zip
    deploy-service-assembly

#top

Static configuration using Maven

These examples use Maven and the jbi-maven-plugin from ServiceMix to start a new ServiceMix instance using a static ServiceMix configuration file.

#top

JBI packaging using Ant

This distribution includes example showing how to build a Service Assembly using Ant.

#top

Static configuration using Ant

There are also a few examples that use Ant to build the example.

#top

Web application

#top

  • No labels