Using ServiceMix to Poll Folder for files

xbean in ServiceMix to poll a particular folder for incoming orders, pass them on to service OrderProcess, move a copy to archive folder and delete original from inbox.

<?xml version="1.0"?>
<beans xmlns:f="http://servicemix.apache.org/file/1.0"
   xmlns:tut="http://www.servicemix.org/ns/jbi"
   xmlns:sm="http://servicemix.apache.org/config/1.0">
   <f:poller
      service="tut:orderfilePoller"
      endpoint="pollEndpoint"
      file="${file.poll.folder}"
      targetService="ex:orderProcess"
      period="${file.poll.period}"
      deleteFile="${file.poll.delete}"
      archive="${file.poll.archive}"
      recursive="${file.poll.recursive}" />

   <bean id="propertyConfigurer"  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="location">
         <value>file:${user.home}/esb/hunt.esb.properties</value>
      </property>
   </bean>
</beans>

hunt.esb.properties

file.poll.folder="file://D://HUNT//ORDERS//INBOX"
file.poll.period=10000
file.poll.delete=true
file.poll.recursive=false
file.poll.archive="file://D://HUNT//ORDERS//SENT"

Comments

Popular posts from this blog

Basic Send Message to MQ with Java and IBM MQ JMS

Basic Receive Message to MQ with Java and IBM MQ JMS

Configure Database Connection using MyBatis