Hi all,

i'v got some questions about the exchange status which is used in the
Servicemix ESB.
i'd like to use it to get a user defined handling if an error occurs. My
projekt is a file - unit which sends the file into a pipeline. the pipeline
sends it to a xslt - transformer unit which returns the transformed message
back to the pipeline. 

on Success: the message will be received to a jms unit which writes the
message to a messagequeue

on Error: the file shoud be moved to an other directory. 

I think, an error could only occur in the  tranformation unit if the xml
document is not valid. So the component receives the exchange status = error
back to the pipeline.

The Filepoller only deletes the file if it got the status done (is it
write?) . Therefore i think it should be possible to add for example a bean
with an own class to copy the file to an other directory, but i don't know
how to implement the bean in the file component.  

Has anybody en idea how to realize it?

My filepoller is a simple one like this:
<beans xmlns:f="http://servicemix.apache.org/file/1.0";
       xmlns:b="http://servicemix.apache.org/OpenTransToPdf/bridge";>

  <f:poller
      service="b:FilePoller"
      endpoint="FilePoller"
      file="file:///C:\Servicemix\inbox"
      targetService="b:Pipeline"
      period="30000"
      recursive="true"
      autoCreateDirectory="true">
          
          <property name="filter">
            <bean class="org.apache.commons.io.filefilter.WildcardFilter">
                <constructor-arg value="*.xml" />
            </bean>
      </property>

           <property name="marshaler">
                  <bean 
                        
class="org.apache.servicemix.components.util.DefaultFileMarshaler">     
                </bean>
      </property>
          
    </f:poller>

Thanks for your Help 
Regards Stefan
-- 
View this message in context: 
http://www.nabble.com/Exchange-Status-to-handle-Errors-tp21328296p21328296.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to