Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Most of the examples that ship with ServiceMix are not delivered in the JBI component/service assembly form but as servicemix.xml configurations that utilize the SpringJBIContainer infrastructure in ServiceMix. This approach lets you quickly get a JBI architecture up and running and while not directly in-line with the JSR-208 specification it is a powerful approach.

Info
titleUseful Information

Note that if you are planning on using the components that ship with ServiceMix there libraries are not included in the ServiceMix JBoss deployer, therefore you will need to copy your $SERVICEMIX_HOME/lib and $SERVICEMIX_HOME/lib/optional directories to your application server's library path (ie. $JBOSS_HOME/server/default/lib).

Since it is this approach that most people start with we added the ability to deploy this Spring JBI configurations onto JBoss, in order to do this deploy the 1.0-SNAPSHOT deployer that you see below and then take a servicemix.xml configuration file and rename it so that it ends in -sm.xml (ie. vfs-sm.xml), then you will need to make same basic modification to get it running:

Example vfs-sm.xml

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:my="http://servicemix.org/demo/">
  <!-- the JBI container -->
  <container id="jbi">  
   <property name="createMBeanServer" value="false"/>
   <property name="dumpStats" value="true"/>
   <property name="statsInterval" value="10"/>  
    <components>
      <!-- Look for files in the inbox directory -->
      <component id="filePoller" service="foo:filePoller" class="org.servicemix.components.vfs.FilePoller" destinationService="foo:receiver">
        <property name="workManager" ref="workManager"/>
        <property name="path" value="file:L:\\servicemix-inbox\"/>
        <property name="period" value="1000"/>
     </component>    
      <!-- Write files to the outbox directory -->
     <component id="fileSender" service="foo:receiver" class="org.servicemix.components.vfs.FileWriter">
        <property name="path" value="file:L:\\servicemix-outbox\"/>
        <property name="marshaler">
           <bean class="org.servicemix.components.util.DefaultFileMarshaler">
              <property name="fileName">
                  <bean class="org.servicemix.expression.JaxenStringXPathExpression">
                     <constructor-arg value="concat('sample_', /sample/@id, '.xml')"/>
                  </bean>
              </property>
           </bean>
        </property>
     </component>
    </components>
  </container>
  <!-- the work manager (thread pool) for this container -->
  <bean id="workManager" class="org.activemq.work.SpringWorkManager">
    <property name="startMaximumPoolSize" value="30"/>
    <property name="syncMaximumPoolSize" value="30"/>
    <property name="scheduledMaximumPoolSize" value="30"/>
  </bean>
</beans>

Above is the VFS example, however note that to run under JBoss you need to make sure that the createMBeanServer property is false.

...

titleUseful Information

...

.

To make life a little easier you can download the JBoss Deployer for ServiceMix M2