Wiki Markup |
---|
{scrollbar} |
Anchor | ||||
---|---|---|---|---|
|
4. Examples
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
- #Maven configuration
- #JBI packaging
- #Static configuration using Maven
- #Static configuration using Ant
- #Web application
Here are the examples shipped with ServiceMix:
- Basic
- Bridge
- Cluster
- File Binding
- Loan Broker
- Loan Broker BPEL
- RSS Binding
- VFS Binding
- WSDL First
- WS-Notification Clustered
- WS-Notification HTTP Binding
Maven configuration
ServiceMix release is not available on public maven repositories, so you need to either:
- build ServiceMix from sources
- modify your maven configuration to include an additional repository.
The last point can be done by modifying your ~/.m2/settings.xml
configuration file to include the following informations:
Code Block | ||
---|---|---|
| ||
<settings> <profiles> <profile> <id>incubating</id> <repositories> <repository> <id>apache-incubating</id> <url>http://people.apache.org/repo/m2-incubating-repository</url> </repository> </repositories> </profile> </profiles> <activeProfiles> <activeProfile>incubating</activeProfile> </activeProfiles> </settings> |
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:
Code Block |
---|
cd [servicemix_install_dir] bin/servicemix |
Using maven, you can launch the following command to build the Service Assembly:
Code Block |
---|
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:
Code Block |
---|
cd [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:
Code Block |
---|
cd [servicemix_install_dir] bin/servicemix |
Install the needed components and shared libraries:
Code Block |
---|
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:
Code Block |
---|
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:
Code Block |
---|
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:
Code Block |
---|
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 |
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.
JBI packaging using Ant
This distribution includes example showing how to build a Service Assembly using Ant.
Static configuration using Ant
There are also a few examples that use Ant to build the example.
Web application
Wiki Markup |
---|
{scrollbar} |