Labels

algorithms (22) Design Patterns (20) java (19) linux (14) Snippet (13) service mix (6) soa (4)

ServiceMix EIP Pipeline

MVN command to create a eip
mvn archetype:generate -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-eip-service-unit -DarchetypeVersion=2010.01 -DgroupId=com.bytes.tutorial -DartifactId=eip-su -Dversion=1.01
[INFO] Using property: groupId = com.bytes.tutorial
[INFO] Using property: artifactId = eip-su
[INFO] Using property: version = 1.01
[INFO] Using property: package = com.bytes.tutorial
Confirm properties configuration:
groupId: com.bytes.tutorial
artifactId: eip-su
version: 1.01
package: com.bytes.tutorial
Y: y
the eip su is then created ,add this as dependency to the SA
<dependency>

<groupId>com.bytes.tutorial</groupId>

<artifactId>eip-su</artifactId>

<version>1.01</version>

</dependency>
the XBEAN.XML generated will have all examples of the patterns that can be used.
we can use pipe pattern
Source DIR => File-Poller => bytes:pipeline=> myBeanService=> File-Sender => Destination DIR
<eip:pipeline service="bytes:eipPipeBean" endpoint="endpoint">
<eip:transformer>
<eip:exchange-target service="bytes:myBeanService" />
</eip:transformer>
<eip:target>
<eip:exchange-target service="bytes:file_sender" />
</eip:target>
</eip:pipeline>



As show above this EIP pipeline is configured in such a way that


the bean “bytes:myBeanService” processes the data and gives it to the bytes:file_sender .


that should take care of writing the files to that directory.


find the sample code here => Example

1 comment:

Search 24 Bytes