diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1fabcf7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +target +*.i?? +.idea +.settings +.project +.classpath \ No newline at end of file diff --git a/README.md b/README.md index 72db016..68355f7 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ -File Batch Splitter Camel Project -================================= +# File Batch Splitter Camel Project This project demonstrates how to consume files from the file system and split the content of the file into multiple messages using Apache Camel. The sample implements the Splitter EIP (Enterprise Integration Pattern) which splits an incoming message into a series of outgoing messages. Each of the outgoing messages contains a piece of the original message. -A sample incoming message file 'batch1.xml' is located in src/data/inbox. When the route is run, the split result files will be located in target/data/outbox. +A sample incoming message file 'order1.xml' is located in src/data/inbox. When the route is run, the split result files will be located in target/data/outbox. This project was created with FuseSource Camel IDE available at http://fusesource.com/products/fuse-ide-camel/ which gives you a nice visualization of your routes, the ability to drag and drop Apache Camel components to design and edit routes, and testing capabilities within the Eclipse IDE. @@ -18,4 +17,51 @@ To run the example project as a standalone Camel route, execute the following co For more help see the Apache Camel documentation http://camel.apache.org/splitter.html - \ No newline at end of file + +--- + +# File batch Splitter with Fuse + + +You can also run this bundle by installing it into Fuse ESB + +To build the project and execute the unit test, execute the following command: + $PROJECT_HOME> mvn clean install + +Start Fuse ESB, by running the included start script + + $FUSE_ESB_HOME> ./bin/fuseesb + +Now You can install the bundle using the Fuse console + + FuseESB:karaf@root> osgi:install mvn:com.fusesource.byexample/FileBatchSplitter/1.0.1 + +You can see that the bundle is installed by running the list command + + FuseESB:karaf@root> list + ... + [ 250] [Installed ] [ ] [ ] [ 60] File Batch Splitter (1.0.1) + ... + +In this case, 250 is the bundle id. This can be different on your instance of Fuse. You can start this bundle by +executing `osgi:start (bundle-id)`. + + FuseESB:karaf@root> osgi:start 250 + FuseESB:karaf@root> list + ... + [ 250] [Active ] [ ] [Started] [ 60] File Batch Splitter (1.0.1) + ... + +To activate this route, you have to copy the `order1.xml`file to the `$FUSE_ESB_HOME/src/data/inbox` folder. So you open +a new console... + + $PROJECT_HOME> cp src/data/inbox/order1.xml $FUSE_ESB_HOME/src/data/inbox/ + + +If we go to the `$FUSE_ESB_HOME/target/data/outbox` folder, you can see te resulting files. + + item1-2013032213582300693.xml + item2-2013032213582300693.xml + item3-2013032213582300693.xml + item4-2013032213582300693.xml + item5-2013032213582300693.xml diff --git a/pom.xml b/pom.xml index 43a1076..ed6450a 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ com.fusesource.byexample FileBatchSplitter - jar + bundle 1.0.1 File Batch Splitter @@ -33,7 +33,7 @@ - 2.8.0-fuse-02-05 + 2.10.0.fuse-71-047 1.6.2 @@ -78,7 +78,7 @@ org.apache.camel - camel-test + camel-test-spring ${camel-version} test @@ -117,6 +117,14 @@ ${camel-version} + + + + org.apache.felix + maven-bundle-plugin + 2.3.7 + true +