Announcement Announcement Module
Collapse
No announcement yet.
why file:outbound creates two files? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • why file:outbound creates two files?

    Hi everybody!

    I have a JMS listener and i would like to save the message in a temporal file, the contain of this file is replaced each time that the listener listen a message. What is happening is: with the first message the copy is created fine, but the second one has the extension "null" and from this moment the file that is replaced is temporal.txtnull and not temporal.txt.

    Here is the code:
    Code:
    	<transformer input-channel="toAddPath"
    		output-channel="toSaveFile" 
    		id="addPath" 
    		method="addHeader"
    		ref="refaddPath"/>
    	<beans:bean name="refaddPath" class="message.modHeader">
       		<beans:property name="headername" value="ORIGINAL_FILE"/>
       		<beans:property name="headervalue" value="${temporal.path}"/>
       	</beans:bean>
    	<channel id="toSaveFile"/>
    
    	<file:outbound-channel-adapter id="fileout" channel="toSaveFile"
    		directory="${temporal.path}"
    		filename-generator-expression="'temporal.txt'"
    		delete-source-files="true" />
    Could anybody help me? thanks!

  • #2
    any suggestion?

    Comment


    • #3
      There are a couple of things going on here.

      First, the temporary file suffix is NULL, this looks like a bug to me, it should be '.writing' by default.

      The adapter writes to a temporary file, with this suffix, and then renames to the final filename.

      It looks like the rename is failing - but that should result in an exception. Do you see anything in the log?

      What version of Spring Integration are you using?

      Comment


      • #4
        The detection of the rename failure is in 2.1.0; it is not yet available in 2.0.x...

        https://jira.springsource.org/browse/INT-2278

        ...it will be available in 2.0.6 when it is released (shortly).

        BTW, the failure might be happening because something else has the file locked, or maybe changed its permissions.

        Comment

        Working...
        X