Announcement Announcement Module
Collapse
No announcement yet.
Service activator behaving erratically Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Service activator behaving erratically

    I have two service activators in the following combination

    inound-channel-adapter--->service-activator1--->outbound-channel-adapter--->service-activator2
    The application copies file from landing to destination. Problem is that service-activator2 is getting called in some cases even before the flow before that completes. Any reason for this?
    here are my config details:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	   xmlns:integration="http://www.springframework.org/schema/integration"
    	   xmlns:file="http://www.springframework.org/schema/integration/file"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
    						http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    						http://www.springframework.org/schema/integration/file
    						http://www.springframework.org/schema/integration/file/spring-integration-file-2.2.xsd 
    						http://www.springframework.org/schema/integration
    						http://www.springframework.org/schema/integration/spring-integration-2.2.xsd">
    	
    	
    	<file:inbound-channel-adapter id="filesIn" directory="file:C:/test/tmpInbound" scanner="myscanner">
    		<integration:poller id="poller" fixed-delay="1000" />
    	</file:inbound-channel-adapter>	
    	
    	
    	<integration:service-activator input-channel="filesIn" output-channel="filesOut" ref="handler" />	
    	 <file:outbound-channel-adapter id="filesOut" directory="file:C:/test/DR" delete-source-files="false" filename-generator="writer" ref="complete"/>
    	  
    	 	
    <integration:service-activator input-channel="filesOut" ref="complete"/>	
    	
    	 
    	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
    	<bean id="myscanner" class="org.springframework.integration.file.RecursiveLeafOnlyDirectoryScanner" />
    	<bean id="handler" class="com.watcher.Handler" />
    	<bean id="writer" class="com.watcher.Writer" />
    	<bean id="complete" class="com.watcher.Complete" />
    </beans>
    Heres the application logging that shows the erratic behaviour. Bitmap Image1.bmp is getting picked up by the second service-activator even before th inbound poller picks it up. As a result the copy fails.

    ************start***************
    generateFileName(C:\test\tmpInbound\Bitmap Image0.bmp)
    {timestamp=1358314500737, id=575d8e7d-a959-4b8a-b5b6-19689588319c}
    Bitmap Image0.bmp
    Original ---> C:\test\tmpInbound\Bitmap Image0.bmp
    Final --> \Bitmap Image0.bmp0.13921170863669796
    *************done***************

    Jan 16, 2013 12:35:01 AM org.springframework.integration.file.FileReadingMe ssageSource receive
    INFO: Created message: [[Payload=C:\test\tmpInbound\Bitmap Image1.bmp][Headers={timestamp=1358314501783, id=6f807524-33a1-4ed5-8e86-907c9a63f6e2}]]
    [COMPLETE in sservice-activator2] C:\test\tmpInbound\Bitmap Image1.bmpJan 16, 2013 12:35:02 AM org.springframework.integration.file.FileReadingMe ssageSource receive
    INFO: Created message: [[Payload=C:\test\tmpInbound\Bitmap Image2.bmp][Headers={timestamp=1358314502799, id=33a7932c-0d2a-444f-bf5a-a85f0bfac6f7}]]

    ************start***************
    generateFileName(C:\test\tmpInbound\Bitmap Image2.bmp)
    {timestamp=1358314502799, id=8a2695bf-0b86-4cfa-9d22-f97e110258c0}
    Bitmap Image2.bmp
    Original ---> C:\test\tmpInbound\Bitmap Image2.bmp
    Final --> \Bitmap Image2.bmp0.19998457677029258
    *************done***************
    While for the remaining two files its not getting called at all... plz help


    Thanks
    Anirban

  • #2
    See my reply on the other post (http://forum.springsource.org/showth...ng-erratically) - please don't post the same question multiple times - for some reason your posts required approval, I am not sure why.

    Comment

    Working...
    X