...
This tutorial shows the desired/best practices or "clean" way to create a SE-SA-SU using ServiceMix Maven archetypes and the Maven plugin (see Maven JBI plugin), so how the workflow shall be - of course, other possibilities exist and may be better suited for certain situations. Furthermore, it will explain the reasons for critical choices and how required information can be retrieved. Where appropriate, additional reading will be is suggested.
To make it as easy as possible to follow the descriptions, they contain only the relevant code snippets, while the full code is available in the SVN repository. Please note that the code snippets are fetched directly from the full code in the SVN repository, thus the wiki and the code share always at the same, up to date state.
Tip | ||
---|---|---|
| ||
This tutorial is especially useful for ServiceMix beginners. The Maven Getting Started Guide is a recommended and short reading. It explains most of the Maven related things needed. |
Warningnote | ||
---|---|---|
| ||
INS When to use this JBI Component provide exact position in the SVN! maybe moving the content of overlapping existing docus to this new tut and - where appropriate - delete the old ones (only leaving a redirect). ServiceMix can be used as a protocol bridge. The following tutorial will explain how to create a JBI Service Assembly (aka a JBI application) to bridge two different protocols. In this example, we will bridge the HTTP/SOAP with the JMS protocol using an InOnly MEP. We will also put between the two protocols an XSLT transformation. provide additional reading Maybe add testing This shall already include everything stated at provide additional reading |
Prerequisites
The following is required:
...
Panel | ||
---|---|---|
|
...
No Format |
---|
[INFO] Scanning for projects... [INFO] ---------------------------------------------------------------------------- [INFO] Building A custom project [INFO] task-segment: [test] [INFO] ---------------------------------------------------------------------------- ... [INFO] [compiler:compile] ... [INFO] [surefire:test] [INFO] Setting reports dir: c:\java\tmp\servicemix-helloWorldSE\target/surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- [surefire] Running org.apache.servicemix.samples.helloWorldSE.MySpringComponentTest ... [surefire] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 1,422 sec [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ ... |
Note | ||
---|---|---|
| ||
Maybe add further testingat the end of the tutarial (as "how to continue when having the working example") |
Generation and deployment of the SA
...
Note | ||
---|---|---|
| ||
When working with the jbi:projectDeploy one may want to disable dependency deployment. When deploying to a server which has other components sharing these dependencies, they can cause problems while trying to undeploy and redeploy them. To stop the jbi-maven-plugin undeploying and redeploying dependencies, the configuration files (usually in the SA's or the component's pom.xml) have to be extended by a new element entity called deployDependencies with a value of false (<deployDependencies>false</deployDependencies>). This has to be placed in the configuration section for the jbi-maven-plugin. The final structure looks like this :(reduced to the bare minimum, the inserted entity is bold): <build> |
Adding functionality
Configuring the Service Assembly
manually editing http://goopen.org/confluence/display/SM/Working+with+Service+Units
manually editing http://www.servicemix.org/site/working-with-service-assemblies.html
use the SU archetype like in http://www.servicemix.org/site/creating-a-protocol-bridge.html
use the SA archetype like in http://www.servicemix.org/site/creating-a-protocol-bridge.html
The structure is done, so the functionality have to be added. Using an IDE like IDEA or
Eclipse this is easier; here, the workflow with Eclipse is described.Â
Note | ||
---|---|---|
| ||
The default implementation of the component accepts InOut MEPs (ADD manually editing http://www.servicemix.org/site/working-with-service-assemblies.html use the SU archetype like in | ||
Note | ||
| ||
it and we now need to fill the holes. Then you can send an request to ... The default implementation of the component accepts InOut MEPs and return the input content as the out message. Using an IDE to add meat to the component. You can either use IDEA or Eclipse, I tried it with Eclipse so I guess I am going to stick it for now. <TODO> This shall already include everything stated at use the SA archetype like in http://www.servicemix.org/site/workingcreating-a-withprotocol-componentsbridge.html |