You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by smo001 <s....@titoco.de> on 2009/01/07 11:02:15 UTC

Exchange Status to handle Errors


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.


Re: Exchange Status to handle Errors

Posted by smo001 <s....@titoco.de>.


smo001 wrote:
> 
> Hello again,
> 
> is there anybody who can explain me how to forward a message in a bean
> listener component. I have tested a lot of possibilities but nothing works
> correctly. As i wrote in the last post, i'd like to do special error
> handling with the onMessageExchange method. i biuld a bean project an
> placed it between my to components. 
> 
> I get the message (InOnly) from my file component, but i find no way to
> send it to my pipeline with my bean. The bean should forward the message
> if the exchang status equals active, and should handle en error if the
> exchange status equals error. 
> 
> My problem is how to set the targetservice in the bean. I tested using the
> setEndpoint and setService methods, build a ServicemixClient in my bean,
> but it didn't run. Then i read that i have to set the exchange status to
> done if i work with an inonly messages, but i got only nullpointer
> exceptions, and i don't know whats going wrong. 
> 
> Is there anyone who could explain me how to build such an error handler,
> do i need a build in ServicemixClient, or how to set a targetservice in a
> listener bean to receive the message to a target. 
> 
> Thank you for your help,
> Regards
> 
> Stefan    
> 

-- 
View this message in context: http://www.nabble.com/Exchange-Status-to-handle-Errors-tp21328296p21549701.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Exchange Status to handle Errors

Posted by smo001 <s....@titoco.de>.
Hello again,

is there anybody who can explain me how to forward a message in a bean
listener component. I have tested a lot of possibilities but nothing works
correctly. As i wrote in the last post, i'd like to do special error
handling with the onMessageExchange method. i biuld a bean project an placed
it between my to components. 

I get the message (InOnly) from my file component, but i find no way to send
it to my pipeline with my bean. The bean should forward the message if the
exchang status equals active, and should handle en error if the exchange
status equals error. 

My problem is how to set the targetservice in the bean. I tested using the
setEndpoint and setService methods, build a ServicemixClient in my bean, but
it didn't run. Then i read that i have to set the exchange status to done if
i work with an inonly messages, but i got only nullpointer exceptions, and i
don't know whats going wrong. 

Is there anyone who could explain me how to build such an error handler, do
i need a build in ServicemixClient, or how to set a targetservice in a
listener bean to receive the message to a target. 

Thank you for your help,
Regards

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


Re: Exchange Status to handle Errors

Posted by Ron Gavlin <rg...@yahoo.com>.
Greetings,

First, you might consider inserting a smx-camel errorHandler into your flow between your smx-file:poller and your smx-bean. The smx-camel errorHandler would catch the error returned by your bean and forward it to another endpoint (maybe a different smx-bean) to compensate for the error. 

Second, you might consider having your smx-bean extend the TransformBeanSupport smx-bean helper class. In this case, the JBI messaging is handled in the base class. All you must do is implement a transform() method. Here, you use Spring dependency injection to inject an ExchangeTarget into your smx-bean to identify the "follow-on" endpoint in your flow.

/Ron



----- Original Message ----
From: smo001 <s....@titoco.de>
To: users@servicemix.apache.org
Sent: Monday, January 19, 2009 2:22:52 PM
Subject: Re: Exchange Status to handle Errors


Hello again, 

is there anybody who can explain me how to forward a message in a bean
listener component. I have tested a lot of possibilities but nothing works
correctly. As i wrote in the last post, i'd like to do special error
handling with the onMessageExchange method. i biuld a bean project an placed
it between my to components. 

I get the message (InOnly) from my file component, but i find no way to send
it to my pipeline with my bean. The bean should forward the message if the
exchang status equals active, and should handle en error if the exchange
status equals error. 

My problem is how to set the targetservice in the bean. I tested using the
setEndpoint and setService methods, build a ServicemixClient in my bean, but
it didn't run. Then i read that i have to set the exchange status to done if
i work with an inonly messages, but i got only nullpointer exceptions, and i
don't know whats going wrong. 

Is there anyone who could explain me how to build such an error handler, do
i need a build in ServicemixClient, or how to set a targetservice in a
listener bean to receive the message to a target. 

Thank you for your help, 
Regards 

Stefan  


smo001 wrote:
> 
> 
> Hello again,
> 
> ok i found a new problem in my service. i have implemented the bean, and
> put your example code into my java file. I add a try - catch block for the
> SourceTransformer. After that, i worte the xbean.xml and add the routing. 
> 
> It's now structured like this:   Filepoller -> Errorlistener -> Pipeline
> <-> XsltTransformer 
>                                                                                
> |
>                                                                          
> JMS Consumer
> in the xbean.xml from the Errorlistener i wrote the pipeline as
> targetservice an in filepoller the targetservice is set to the
> Errorlistener.
> 
> My xbean.xml from the Errorlistener: 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
>        xmlns:b="http://servicemix.apache.org/myProjekt/bridge">
>    
>     <bean:endpoint service="b:ErrorListener" endpoint="ErrorListener"
> bean="#Error"  targetService="b:Pipeline">    
>     <bean id="Error"
> class="org.apache.servicemix.myProject.MyErrorListener"/>
>   </beans>
> 
> The Class is now (only the onMessage Method): 
> 
> public void onMessageExchange(MessageExchange exchange) throws
> MessagingException {
>         if (exchange.getStatus() == ExchangeStatus.ERROR) {
>                  NormalizedMessage message = exchange.getMessage("in");
>                  Source content = message.getContent();
>                  try {
>                      String body = (new SourceTransformer()).toString(content);
>                  } catch (TransformerException e){
>                      System.out.println("Caught: " + e);
>                      e.printStackTrace();
>                  }        
>                 // ***** Write the message to a directory ****
>                 channel.send(exchange);
> 
>             } else if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
>                 channel.send(exchange);
> 
>             } else if (exchange.getStatus() == ExchangeStatus.DONE) {
>                 channel.send(exchange);
> 
>             }
>         }
> 
> It throws this Errormessage: 
> 
> for service: {http://servicemix.apache.org/myProject/bridge}ErrorListener
> and interface: null
>       at
> org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:297)
>       at
> org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:88)
>       at
> org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:894)
>       at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:395)
>       at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:431)
>       at
> org.apache.servicemix.common.EndpointDeliveryChannel.send(EndpointDeliveryChannel.java:88)
>       at
> org.apache.servicemix.common.endpoints.SimpleEndpoint.send(SimpleEndpoint.java:66)
>       at
> org.apache.servicemix.file.FilePollerEndpoint.processFile(FilePollerEndpoint.java:352)
>       at
> org.apache.servicemix.file.FilePollerEndpoint.processFileNow(FilePollerEndpoint.java:333)
>       at
> org.apache.servicemix.file.FilePollerEndpoint$1.run(FilePollerEndpoint.java:317)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>       at java.lang.Thread.run(Thread.java:619)
> 
> What does it mean? Is the Message emty or is it necessary to put the
> message in the xbean.xml of the Errorlistener into a container to send it
> to the pipeline?  
> 
> Thanks for your help,
> 
> Cheers Stefan
> 
> 
> 
> 
> 
> 
> smo001 wrote:
>> 
>> 
>> Hello,
>> 
>> thanks for your answer. Now i understand how it works. My solution with
>> the bean component was the right way, but i didn't see that i have to put
>> it between the two components. I'll test it and if there are questions
>> i'll write again.
>> 
>> Thanks Ashwin
>> 
>> Cheers,
>> Stefan 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Ashwin Karpe wrote:
>>> 
>>> Oops, the code should be
>>> 
>>> example of this code is
>>> 
>>> import org.apache.servicemix.jbi.listener.MessageExchangeListener;
>>> import org.apache.servicemix.jbi.util.MessageUtil;
>>> 
>>> import javax.annotation.Resource;
>>> import javax.jbi.messaging.DeliveryChannel;
>>> import javax.jbi.messaging.ExchangeStatus;
>>> import javax.jbi.messaging.MessageExchange;
>>> import javax.jbi.messaging.MessagingException;
>>> 
>>> public class ListenerBean implements MessageExchangeListener {
>>> 
>>>     @Resource
>>>     private DeliveryChannel channel;
>>> 
>>>     public void onMessageExchange(MessageExchange exchange) throws
>>> MessagingException {
>>>         if (exchange.getStatus() == ExchangeStatus.ERROR) {
>>>              NormalizedMessage message = exchange.getMessage("in");
>>>              Source content = message.getContent();
>>>              String body = (new SourceTransformer()).toString(content);
>>>            
>>>             // ***** Write the message to a directory ****
>>>             channel.send(exchange);
>>> 
>>>         }
>>>     }
>>> 
>>> }
>>> 
>>> 
>>> Ashwin Karpe wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> The way to do this is the following.
>>>> 
>>>>    - Create a servicemix-bean that exclusively does error handling (i.e
>>>> check the exchange for Exchange status to be Error/Fault) and writes
>>>> the message to a specific directory. The Exception handling bean will
>>>> typically be a pass through and only kkick in when an exceptionis
>>>> received in the Message Exchange
>>>>    - Introduce this bean between the File SU and the Transformer by
>>>> changing the target Service in the File SU and the Exception Handling
>>>> Bean
>>>>            File SU --> Exception Processing Bean --> Transformer
>>>> 
>>>> An example of this code is
>>>> 
>>>> import org.apache.servicemix.jbi.listener.MessageExchangeListener;
>>>> import org.apache.servicemix.jbi.util.MessageUtil;
>>>> 
>>>> import javax.annotation.Resource;
>>>> import javax.jbi.messaging.DeliveryChannel;
>>>> import javax.jbi.messaging.ExchangeStatus;
>>>> import javax.jbi.messaging.MessageExchange;
>>>> import javax.jbi.messaging.MessagingException;
>>>> 
>>>> public class ListenerBean implements MessageExchangeListener {
>>>> 
>>>>     @Resource
>>>>     private DeliveryChannel channel;
>>>> 
>>>>     public void onMessageExchange(MessageExchange exchange) throws
>>>> MessagingException {
>>>>         if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
>>>>              NormalizedMessage message = exchange.getMessage("in");
>>>>              Source content = message.getContent();
>>>>              String body = (new SourceTransformer()).toString(content);
>>>>            
>>>>             // ***** Write the message to a directory ****
>>>>             channel.send(exchange);
>>>> 
>>>>         }
>>>>     }
>>>> 
>>>> }
>>>> 
>>>> Hope this helps.
>>>> 
>>>> Cheers,
>>>> 
>>>> Ashwin...
>>>> 
>>>> 
>>>> smo001 wrote:
>>>>> 
>>>>> 
>>>>> 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-tp21328296p21549751.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Exchange Status to handle Errors

Posted by smo001 <s....@titoco.de>.
Hello again, 

is there anybody who can explain me how to forward a message in a bean
listener component. I have tested a lot of possibilities but nothing works
correctly. As i wrote in the last post, i'd like to do special error
handling with the onMessageExchange method. i biuld a bean project an placed
it between my to components. 

I get the message (InOnly) from my file component, but i find no way to send
it to my pipeline with my bean. The bean should forward the message if the
exchang status equals active, and should handle en error if the exchange
status equals error. 

My problem is how to set the targetservice in the bean. I tested using the
setEndpoint and setService methods, build a ServicemixClient in my bean, but
it didn't run. Then i read that i have to set the exchange status to done if
i work with an inonly messages, but i got only nullpointer exceptions, and i
don't know whats going wrong. 

Is there anyone who could explain me how to build such an error handler, do
i need a build in ServicemixClient, or how to set a targetservice in a
listener bean to receive the message to a target. 

Thank you for your help, 
Regards 

Stefan  


smo001 wrote:
> 
> 
> Hello again,
> 
> ok i found a new problem in my service. i have implemented the bean, and
> put your example code into my java file. I add a try - catch block for the
> SourceTransformer. After that, i worte the xbean.xml and add the routing. 
> 
> It's now structured like this:   Filepoller -> Errorlistener -> Pipeline
> <-> XsltTransformer 
>                                                                                 
> |
>                                                                           
> JMS Consumer
> in the xbean.xml from the Errorlistener i wrote the pipeline as
> targetservice an in filepoller the targetservice is set to the
> Errorlistener.
> 
> My xbean.xml from the Errorlistener: 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
>        xmlns:b="http://servicemix.apache.org/myProjekt/bridge">
>    
> 	<bean:endpoint service="b:ErrorListener" endpoint="ErrorListener"
> bean="#Error"  targetService="b:Pipeline">	
> 	<bean id="Error"
> class="org.apache.servicemix.myProject.MyErrorListener"/>
>   </beans>
> 
> The Class is now (only the onMessage Method): 
> 
> public void onMessageExchange(MessageExchange exchange) throws
> MessagingException {
> 		if (exchange.getStatus() == ExchangeStatus.ERROR) {
> 	             NormalizedMessage message = exchange.getMessage("in");
> 	             Source content = message.getContent();
> 	             try {
> 	            	 String body = (new SourceTransformer()).toString(content);
> 	             } catch (TransformerException e){
> 	            	 System.out.println("Caught: " + e);
> 	                 e.printStackTrace();
> 	             }        
> 	            // ***** Write the message to a directory ****
> 	            channel.send(exchange);
> 
> 	        } else if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
> 	            channel.send(exchange);
> 
> 	        } else if (exchange.getStatus() == ExchangeStatus.DONE) {
> 	            channel.send(exchange);
> 
> 	        }
> 	    }
> 
> It throws this Errormessage: 
> 
> for service: {http://servicemix.apache.org/myProject/bridge}ErrorListener
> and interface: null
>       at
> org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:297)
>       at
> org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:88)
>       at
> org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:894)
>       at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:395)
>       at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:431)
>       at
> org.apache.servicemix.common.EndpointDeliveryChannel.send(EndpointDeliveryChannel.java:88)
>       at
> org.apache.servicemix.common.endpoints.SimpleEndpoint.send(SimpleEndpoint.java:66)
>       at
> org.apache.servicemix.file.FilePollerEndpoint.processFile(FilePollerEndpoint.java:352)
>       at
> org.apache.servicemix.file.FilePollerEndpoint.processFileNow(FilePollerEndpoint.java:333)
>       at
> org.apache.servicemix.file.FilePollerEndpoint$1.run(FilePollerEndpoint.java:317)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>       at java.lang.Thread.run(Thread.java:619)
> 
> What does it mean? Is the Message emty or is it necessary to put the
> message in the xbean.xml of the Errorlistener into a container to send it
> to the pipeline?  
> 
> Thanks for your help,
> 
> Cheers Stefan
> 
> 
> 
> 
> 
> 
> smo001 wrote:
>> 
>> 
>> Hello,
>> 
>> thanks for your answer. Now i understand how it works. My solution with
>> the bean component was the right way, but i didn't see that i have to put
>> it between the two components. I'll test it and if there are questions
>> i'll write again.
>> 
>> Thanks Ashwin
>> 
>> Cheers,
>> Stefan 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Ashwin Karpe wrote:
>>> 
>>> Oops, the code should be
>>> 
>>> example of this code is
>>> 
>>> import org.apache.servicemix.jbi.listener.MessageExchangeListener;
>>> import org.apache.servicemix.jbi.util.MessageUtil;
>>> 
>>> import javax.annotation.Resource;
>>> import javax.jbi.messaging.DeliveryChannel;
>>> import javax.jbi.messaging.ExchangeStatus;
>>> import javax.jbi.messaging.MessageExchange;
>>> import javax.jbi.messaging.MessagingException;
>>> 
>>> public class ListenerBean implements MessageExchangeListener {
>>> 
>>>     @Resource
>>>     private DeliveryChannel channel;
>>> 
>>>     public void onMessageExchange(MessageExchange exchange) throws
>>> MessagingException {
>>>         if (exchange.getStatus() == ExchangeStatus.ERROR) {
>>>              NormalizedMessage message = exchange.getMessage("in");
>>>              Source content = message.getContent();
>>>              String body = (new SourceTransformer()).toString(content);
>>>             
>>>             // ***** Write the message to a directory ****
>>>             channel.send(exchange);
>>> 
>>>         }
>>>     }
>>> 
>>> }
>>> 
>>> 
>>> Ashwin Karpe wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> The way to do this is the following.
>>>> 
>>>>    - Create a servicemix-bean that exclusively does error handling (i.e
>>>> check the exchange for Exchange status to be Error/Fault) and writes
>>>> the message to a specific directory. The Exception handling bean will
>>>> typically be a pass through and only kkick in when an exceptionis
>>>> received in the Message Exchange
>>>>    - Introduce this bean between the File SU and the Transformer by
>>>> changing the target Service in the File SU and the Exception Handling
>>>> Bean
>>>>            File SU --> Exception Processing Bean --> Transformer
>>>> 
>>>> An example of this code is
>>>> 
>>>> import org.apache.servicemix.jbi.listener.MessageExchangeListener;
>>>> import org.apache.servicemix.jbi.util.MessageUtil;
>>>> 
>>>> import javax.annotation.Resource;
>>>> import javax.jbi.messaging.DeliveryChannel;
>>>> import javax.jbi.messaging.ExchangeStatus;
>>>> import javax.jbi.messaging.MessageExchange;
>>>> import javax.jbi.messaging.MessagingException;
>>>> 
>>>> public class ListenerBean implements MessageExchangeListener {
>>>> 
>>>>     @Resource
>>>>     private DeliveryChannel channel;
>>>> 
>>>>     public void onMessageExchange(MessageExchange exchange) throws
>>>> MessagingException {
>>>>         if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
>>>>              NormalizedMessage message = exchange.getMessage("in");
>>>>              Source content = message.getContent();
>>>>              String body = (new SourceTransformer()).toString(content);
>>>>             
>>>>             // ***** Write the message to a directory ****
>>>>             channel.send(exchange);
>>>> 
>>>>         }
>>>>     }
>>>> 
>>>> }
>>>> 
>>>> Hope this helps.
>>>> 
>>>> Cheers,
>>>> 
>>>> Ashwin...
>>>> 
>>>> 
>>>> smo001 wrote:
>>>>> 
>>>>> 
>>>>> 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-tp21328296p21549751.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Exchange Status to handle Errors

Posted by smo001 <s....@titoco.de>.

Hello again,

ok i found a new problem in my service. i have implemented the bean, and put
your example code into my java file. I add a try - catch block for the
SourceTransformer. After that, i worte the xbean.xml and add the routing. 

It's now structured like this:   Filepoller -> Errorlistener -> Pipeline <->
XsltTransformer 
                                                                                
|
                                                                          
JMS Consumer
in the xbean.xml from the Errorlistener i wrote the pipeline as
targetservice an in filepoller the targetservice is set to the
Errorlistener.

My xbean.xml from the Errorlistener: 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
       xmlns:b="http://servicemix.apache.org/myProjekt/bridge">
   
	<bean:endpoint service="b:ErrorListener" endpoint="ErrorListener"
bean="#Error"  targetService="b:Pipeline">	
	<bean id="Error" class="org.apache.servicemix.myProject.MyErrorListener"/>
  </beans>

The Class is now (only the onMessage Method): 

public void onMessageExchange(MessageExchange exchange) throws
MessagingException {
		if (exchange.getStatus() == ExchangeStatus.ERROR) {
	             NormalizedMessage message = exchange.getMessage("in");
	             Source content = message.getContent();
	             try {
	            	 String body = (new SourceTransformer()).toString(content);
	             } catch (TransformerException e){
	            	 System.out.println("Caught: " + e);
	                 e.printStackTrace();
	             }        
	            // ***** Write the message to a directory ****
	            channel.send(exchange);

	        } else if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
	            channel.send(exchange);

	        } else if (exchange.getStatus() == ExchangeStatus.DONE) {
	            channel.send(exchange);

	        }
	    }

It throws this Errormessage: 

for service: {http://servicemix.apache.org/myProject/bridge}ErrorListener
and interface: null
      at
org.apache.servicemix.jbi.nmr.DefaultBroker.sendExchangePacket(DefaultBroker.java:297)
      at
org.apache.servicemix.jbi.security.SecuredBroker.sendExchangePacket(SecuredBroker.java:88)
      at
org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java:894)
      at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(DeliveryChannelImpl.java:395)
      at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.send(DeliveryChannelImpl.java:431)
      at
org.apache.servicemix.common.EndpointDeliveryChannel.send(EndpointDeliveryChannel.java:88)
      at
org.apache.servicemix.common.endpoints.SimpleEndpoint.send(SimpleEndpoint.java:66)
      at
org.apache.servicemix.file.FilePollerEndpoint.processFile(FilePollerEndpoint.java:352)
      at
org.apache.servicemix.file.FilePollerEndpoint.processFileNow(FilePollerEndpoint.java:333)
      at
org.apache.servicemix.file.FilePollerEndpoint$1.run(FilePollerEndpoint.java:317)
      at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      at java.lang.Thread.run(Thread.java:619)

What does it mean? Is the Message emty or is it necessary to put the message
in the xbean.xml of the Errorlistener into a container to send it to the
pipeline?  

Thanks for your help,

Cheers Stefan






smo001 wrote:
> 
> 
> Hello,
> 
> thanks for your answer. Now i understand how it works. My solution with
> the bean component was the right way, but i didn't see that i have to put
> it between the two components. I'll test it and if there are questions
> i'll write again.
> 
> Thanks Ashwin
> 
> Cheers,
> Stefan 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Ashwin Karpe wrote:
>> 
>> Oops, the code should be
>> 
>> example of this code is
>> 
>> import org.apache.servicemix.jbi.listener.MessageExchangeListener;
>> import org.apache.servicemix.jbi.util.MessageUtil;
>> 
>> import javax.annotation.Resource;
>> import javax.jbi.messaging.DeliveryChannel;
>> import javax.jbi.messaging.ExchangeStatus;
>> import javax.jbi.messaging.MessageExchange;
>> import javax.jbi.messaging.MessagingException;
>> 
>> public class ListenerBean implements MessageExchangeListener {
>> 
>>     @Resource
>>     private DeliveryChannel channel;
>> 
>>     public void onMessageExchange(MessageExchange exchange) throws
>> MessagingException {
>>         if (exchange.getStatus() == ExchangeStatus.ERROR) {
>>              NormalizedMessage message = exchange.getMessage("in");
>>              Source content = message.getContent();
>>              String body = (new SourceTransformer()).toString(content);
>>             
>>             // ***** Write the message to a directory ****
>>             channel.send(exchange);
>> 
>>         }
>>     }
>> 
>> }
>> 
>> 
>> Ashwin Karpe wrote:
>>> 
>>> Hi,
>>> 
>>> The way to do this is the following.
>>> 
>>>    - Create a servicemix-bean that exclusively does error handling (i.e
>>> check the exchange for Exchange status to be Error/Fault) and writes the
>>> message to a specific directory. The Exception handling bean will
>>> typically be a pass through and only kkick in when an exceptionis
>>> received in the Message Exchange
>>>    - Introduce this bean between the File SU and the Transformer by
>>> changing the target Service in the File SU and the Exception Handling
>>> Bean
>>>            File SU --> Exception Processing Bean --> Transformer
>>> 
>>> An example of this code is
>>> 
>>> import org.apache.servicemix.jbi.listener.MessageExchangeListener;
>>> import org.apache.servicemix.jbi.util.MessageUtil;
>>> 
>>> import javax.annotation.Resource;
>>> import javax.jbi.messaging.DeliveryChannel;
>>> import javax.jbi.messaging.ExchangeStatus;
>>> import javax.jbi.messaging.MessageExchange;
>>> import javax.jbi.messaging.MessagingException;
>>> 
>>> public class ListenerBean implements MessageExchangeListener {
>>> 
>>>     @Resource
>>>     private DeliveryChannel channel;
>>> 
>>>     public void onMessageExchange(MessageExchange exchange) throws
>>> MessagingException {
>>>         if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
>>>              NormalizedMessage message = exchange.getMessage("in");
>>>              Source content = message.getContent();
>>>              String body = (new SourceTransformer()).toString(content);
>>>             
>>>             // ***** Write the message to a directory ****
>>>             channel.send(exchange);
>>> 
>>>         }
>>>     }
>>> 
>>> }
>>> 
>>> Hope this helps.
>>> 
>>> Cheers,
>>> 
>>> Ashwin...
>>> 
>>> 
>>> smo001 wrote:
>>>> 
>>>> 
>>>> 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-tp21328296p21350724.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Exchange Status to handle Errors

Posted by smo001 <s....@titoco.de>.

Hello,

thanks for your answer. Now i understand how it works. My solution with the
bean component was the right way, but i didn't see that i have to put it
between the two components. I'll test it and if there are questions i'll
write again.

Thanks Ashwin

Cheers,
Stefan 













Ashwin Karpe wrote:
> 
> Oops, the code should be
> 
> example of this code is
> 
> import org.apache.servicemix.jbi.listener.MessageExchangeListener;
> import org.apache.servicemix.jbi.util.MessageUtil;
> 
> import javax.annotation.Resource;
> import javax.jbi.messaging.DeliveryChannel;
> import javax.jbi.messaging.ExchangeStatus;
> import javax.jbi.messaging.MessageExchange;
> import javax.jbi.messaging.MessagingException;
> 
> public class ListenerBean implements MessageExchangeListener {
> 
>     @Resource
>     private DeliveryChannel channel;
> 
>     public void onMessageExchange(MessageExchange exchange) throws
> MessagingException {
>         if (exchange.getStatus() == ExchangeStatus.ERROR) {
>              NormalizedMessage message = exchange.getMessage("in");
>              Source content = message.getContent();
>              String body = (new SourceTransformer()).toString(content);
>             
>             // ***** Write the message to a directory ****
>             channel.send(exchange);
> 
>         }
>     }
> 
> }
> 
> 
> Ashwin Karpe wrote:
>> 
>> Hi,
>> 
>> The way to do this is the following.
>> 
>>    - Create a servicemix-bean that exclusively does error handling (i.e
>> check the exchange for Exchange status to be Error/Fault) and writes the
>> message to a specific directory. The Exception handling bean will
>> typically be a pass through and only kkick in when an exceptionis
>> received in the Message Exchange
>>    - Introduce this bean between the File SU and the Transformer by
>> changing the target Service in the File SU and the Exception Handling
>> Bean
>>            File SU --> Exception Processing Bean --> Transformer
>> 
>> An example of this code is
>> 
>> import org.apache.servicemix.jbi.listener.MessageExchangeListener;
>> import org.apache.servicemix.jbi.util.MessageUtil;
>> 
>> import javax.annotation.Resource;
>> import javax.jbi.messaging.DeliveryChannel;
>> import javax.jbi.messaging.ExchangeStatus;
>> import javax.jbi.messaging.MessageExchange;
>> import javax.jbi.messaging.MessagingException;
>> 
>> public class ListenerBean implements MessageExchangeListener {
>> 
>>     @Resource
>>     private DeliveryChannel channel;
>> 
>>     public void onMessageExchange(MessageExchange exchange) throws
>> MessagingException {
>>         if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
>>              NormalizedMessage message = exchange.getMessage("in");
>>              Source content = message.getContent();
>>              String body = (new SourceTransformer()).toString(content);
>>             
>>             // ***** Write the message to a directory ****
>>             channel.send(exchange);
>> 
>>         }
>>     }
>> 
>> }
>> 
>> Hope this helps.
>> 
>> Cheers,
>> 
>> Ashwin...
>> 
>> 
>> smo001 wrote:
>>> 
>>> 
>>> 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-tp21328296p21333331.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Exchange Status to handle Errors

Posted by Ashwin Karpe <as...@progress.com>.
Oops, the code should be

example of this code is

import org.apache.servicemix.jbi.listener.MessageExchangeListener;
import org.apache.servicemix.jbi.util.MessageUtil;

import javax.annotation.Resource;
import javax.jbi.messaging.DeliveryChannel;
import javax.jbi.messaging.ExchangeStatus;
import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.MessagingException;

public class ListenerBean implements MessageExchangeListener {

    @Resource
    private DeliveryChannel channel;

    public void onMessageExchange(MessageExchange exchange) throws
MessagingException {
        if (exchange.getStatus() == ExchangeStatus.ERROR) {
             NormalizedMessage message = exchange.getMessage("in");
             Source content = message.getContent();
             String body = (new SourceTransformer()).toString(content);
            
            // ***** Write the message to a directory ****
            channel.send(exchange);

        }
    }

}


Ashwin Karpe wrote:
> 
> Hi,
> 
> The way to do this is the following.
> 
>    - Create a servicemix-bean that exclusively does error handling (i.e
> check the exchange for Exchange status to be Error/Fault) and writes the
> message to a specific directory. The Exception handling bean will
> typically be a pass through and only kkick in when an exceptionis received
> in the Message Exchange
>    - Introduce this bean between the File SU and the Transformer by
> changing the target Service in the File SU and the Exception Handling Bean
>            File SU --> Exception Processing Bean --> Transformer
> 
> An example of this code is
> 
> import org.apache.servicemix.jbi.listener.MessageExchangeListener;
> import org.apache.servicemix.jbi.util.MessageUtil;
> 
> import javax.annotation.Resource;
> import javax.jbi.messaging.DeliveryChannel;
> import javax.jbi.messaging.ExchangeStatus;
> import javax.jbi.messaging.MessageExchange;
> import javax.jbi.messaging.MessagingException;
> 
> public class ListenerBean implements MessageExchangeListener {
> 
>     @Resource
>     private DeliveryChannel channel;
> 
>     public void onMessageExchange(MessageExchange exchange) throws
> MessagingException {
>         if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
>              NormalizedMessage message = exchange.getMessage("in");
>              Source content = message.getContent();
>              String body = (new SourceTransformer()).toString(content);
>             
>             // ***** Write the message to a directory ****
>             channel.send(exchange);
> 
>         }
>     }
> 
> }
> 
> Hope this helps.
> 
> Cheers,
> 
> Ashwin...
> 
> 
> smo001 wrote:
>> 
>> 
>> 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
>> 
> 
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Exchange-Status-to-handle-Errors-tp21328296p21330084.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Exchange Status to handle Errors

Posted by Ashwin Karpe <as...@progress.com>.
Hi,

The way to do this is the following.

   - Create a servicemix-bean that exclusively does error handling (i.e
check the exchange for Exchange status to be Error/Fault) and writes the
message to a specific directory. The Exception handling bean will typically
be a pass through and only kkick in when an exceptionis received in the
Message Exchange
   - Introduce this bean between the File SU and the Transformer by changing
the target Service in the File SU and the Exception Handling Bean
           File SU --> Exception Processing Bean --> Transformer

An example of this code is

import org.apache.servicemix.jbi.listener.MessageExchangeListener;
import org.apache.servicemix.jbi.util.MessageUtil;

import javax.annotation.Resource;
import javax.jbi.messaging.DeliveryChannel;
import javax.jbi.messaging.ExchangeStatus;
import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.MessagingException;

public class ListenerBean implements MessageExchangeListener {

    @Resource
    private DeliveryChannel channel;

    public void onMessageExchange(MessageExchange exchange) throws
MessagingException {
        if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
             NormalizedMessage message = exchange.getMessage("in");
             Source content = message.getContent();
             String body = (new SourceTransformer()).toString(content);
            
            // ***** Write the message to a directory ****
            channel.send(exchange);

        }
    }

}

Hope this helps.

Cheers,

Ashwin...


smo001 wrote:
> 
> 
> 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
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: http://www.nabble.com/Exchange-Status-to-handle-Errors-tp21328296p21330058.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.