Tutorial: Creation of a "Hello World - SE"
Note: The content of this document is overlapping with Creating a Standard JBI Component and Notes on Creating JBI Component using maven2. Any changes you might want to do for this document might be relevant for them as well. Questions unanswered by this document may be answered by the other documents.
This tutorial describes how to create a very simple "Hello world" JBI service engine (SE) component, pack it into a Service Unit (SU) which will be packed to a Service Assambly (SA), and finally how to run the SE inside ServiceMix. The SE will answer received messages with "Hello, I received xyz bytes!", so we literally see that it works. As it has the same structure as real, useful SE, the given hints help to use the presented code as a blueprint to create own SE-SA-SUs. Still, the example is as minimalistic as possible, so readers shall not get lost in too many details but get an idea of the big picture.
...
Note | ||
---|---|---|
| ||
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). This shall already include everything stated at provide additional reading |
...
Maven creates a new folder having the same name as the artifact ID provided (printed in green in the command and output). Inside this folder, a file called pom.xml is created. This contains the Project Object Model providing Maven with all needed information for building (see Introduction to the POM at the Maven website). Moreover, Java source files and tests were created.
Note | ||
---|---|---|
| ||
The maven-archetype-plugin 1.0-alpha4 or above is required for this tutorial. When an older version is installed, a BUILD ERROR will occur. The version can be checked by having a look at the name of the directories contained in ~/.m2/repository/org/apache/maven/plugins/maven-archetype-plugin (~ is you user directory, on Windows C:\Documents and Settings\<USERNAME>). In case only an older version is presend, we create a minimal pom.xml in the folder where we're calling the mvn archetype:create goal in (so the current folder) and fill the created file with the following content: <?xml version="1.0" encoding="UTF-8"?> |
Creating the stub of the SU and SA
...