Author: ccustine
Date: Thu Sep 3 17:42:31 2009
New Revision: 811054
URL: http://svn.apache.org/viewvc?rev=811054&view=rev
Log:
SMX4-286 Restructure and add more description to 'bridge' example
- Great doc patches from Aidan Hollinshead
Modified:
servicemix/smx4/features/trunk/examples/bridge/README.txt
Modified: servicemix/smx4/features/trunk/examples/bridge/README.txt
URL:
http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/examples/bridge/README.txt?rev=811054&r1=811053&r2=811054&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/examples/bridge/README.txt (original)
+++ servicemix/smx4/features/trunk/examples/bridge/README.txt Thu Sep 3
17:42:31 2009
@@ -15,32 +15,146 @@
* limitations under the License.
*/
-Welcome to the ServiceMix Bridge Example
-========================================
+EIP JBI BRIDGE EXAMPLE
+======================
-This example shows a bridge between the HTTP and JMS protocols,
-with an XSLT transformation in between.
+Purpose
+-------
+Use the original ServiceMix EIP component and JBI to create a protocol
+bridge that receives a message via HTTP, transforms it, and sends it to
+a JMS queue.
+
+This example uses the older ServiceMix EIP implementation.
+The bridge-camel example, on the other hand, uses Camel to achieve
+the same result. For more details on how Camel compares to ServiceMix EIP,
+see: http://camel.apache.org/how-does-camel-compare-to-servicemix-eip.html
+
+
+Explanation
+-----------
+The protocol bridge consists of four JBI Service Units (SUs)
+wrapped up in a JBI Service Assembly (SA). The SA is deployed
+to ServiceMix.
+
+The SUs can be described as follows:
+
+1. HTTP SU (see the bridge-http-su directory)
+ A HTTP endpoint that listens on port 8192 for HTTP requests.
+
+2. EIP Pipeline SU (see the bridge-eip-su directory)
+ An EIP pipeline that receives HTTP requests, forwards them to
+ the XSLT transform, and takes the results of the transform and
+ passes them to the ActiveMQ JMS endpoint.
+
+3. XSLT SU (see the bridge-xslt-su directory)
+ Uses the bridge.xslt XSL file to convert the message into the
+ format required by JMS. The example XSLT performs a very basic
+ transformation and is for demonstration purposes only.
+
+4. JMS SU (see the bridge-jms-su directory)
+ An ActiveMQ JMS endpoint to which the EIP pipeline sends
+ messages.
+
+The configuration for each SU is contained in the xbean.xml file
+that is located in the src/main/resources directory for that SU.
+For example, configuration for the HTTP SU is contained in the
+xbean.xml file located in the bridge-http-su/src/main/resources
+directory.
+
+The bridge-sa directory contains the POM file that tells Maven how
+to build the SA for this example.
+
+
+Prerequisites for Running this Example
+--------------------------------------
+1. You must have the following installed on your machine:
+
+ - JDK 1.5 or higher.
+
+ - Apache Maven 2.0.6 or higher.
-First start a ServiceMix server (if not already started) by running
- bin/servicemix
-in the root dir of this distribution.
+ For more information, see the README in the top-level
+ examples directory.
+
+
+2. Launch the ServiceMix server by running the following command:
+
+ <servicemix_home>/bin/servicemix (on UNIX)
+ <servicemix_home>\bin\servicemix (on Windows)
+
+
+Building and Deploying
+----------------------
+This example uses the ServiceMix JBI Maven plugin to build the
+SUs and the SA. To build the example, run the following command
+(from the directory that contains this README):
-To start this sample, run:
mvn install
+
+
+If all of the required bundles are available in your local
+Maven repository, the example will build quickly. Otherwise
+it may take some time for Maven to download everything it needs.
+
+Once complete, you will find the SA, called bridge-sa-${version}.zip,
+in the bridge-sa/target directory of this example.
+
+You can deploy the SA in two ways:
+
+- Using Hot Deployment
+ --------------------
+
+ Copy the bridge-sa-${version}.zip file to the
+ <servicemix_home>/deploy directory.
+
+- Using the ServiceMix Console
+ ----------------------------
+
+ Type the following command:
+
+ osgi/install -s
mvn:org.apache.servicemix.examples.bridge/bridge-sa/${version}/zip
-You can deploy the example on ServiceMix 4 in two different ways:
-- using hotdeploy:
- copy the bridge-sa/target/bridge-sa-${version}.zip to
<servicemix_home>/deploy
-- using the ServiceMix console:
- osgi/install -s
mvn:org.apache.servicemix.examples.bridge/bridge-sa/${version}/zip
+
+Running a Client
+----------------
+To run the web client:
+
+1. Open the client.html file, which is located in the same directory
+ as this README file, in your favorite browser.
+
+2. Send a HTTP request. It will be transformed into a JMS message.
+
+ Once the JMS message is sent to the bridge.output queue, you will
+ receive a HTTP STATUS 202 response code from the ESB.
+
+
+To run the java code client:
+
+1. Change to the <servicemix_home>/examples/bridge/client directory.
+
+2. Run the following command:
+
+ mvn compile exec:java
+
+
+Viewing the Log Entries
+-----------------------
+You can view the message that is sent by viewing the log entries
+in the servicemix.log file in the data/log directory of your
+ServiceMix installation, or by typing the following
+command in the ServiceMix console:
+
+ log/d
-You can then launch the client.html in your favorite browser
-and send an HTTP request which will be transformed in a JMS
-message. After the JMS message has been sent to the bridge.output queue
successfully,
-you will receive an HTTP STATUS 202 response code from the ESB.
-Or you can launch java code client to send the request
-cd client; mvn compile exec:java
-For more information on running this example please see:
- http://servicemix.apache.org/bridge.html
+Changing the Example
+--------------------
+If you change the code or configuration in this example, use
+'mvn install' to rebuild the JBI SA zip, and deploy it as described
+above.
+
+More Information
+----------------
+For more information about this example, see:
+ http://servicemix.apache.org/creating-a-protocol-bridge.html