[ 
https://issues.apache.org/activemq/browse/SM-1292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41837#action_41837
 ] 

Guillaume Nodet commented on SM-1292:
-------------------------------------

It can already be done easily afaik.

{code}
<file:sender service="test:service" endpoint="endpoint" 
directory="file:target/componentOutput">
  <file:marshaler>
    <sm:defaultFileMarshaler>
      <sm:fileName>
        <!-- lets use a header from the message -->
        <sm:xpathString xpath="concat($name, '.xml')"/>
      </sm:fileName>
    </sm:defaultFileMarshaler>
  </file:marshaler>
</file:sender>
{code}

Just implementing an expression that returns a unique identifier (or 
incremening counter) would work.

I think the problem of outbound clustering is precisely when several endpoints 
need to write to the same file (let's say you use an append mode somehow), and 
we need a locking mechanism.

Another problem is when a file provider write to a file, and a file consumer 
consume those files.  Or even if you need to communicate to some external 
systems.  In such cases, the consumer needs to know when the file has been 
fully written so that it can be read.  This requires a locking mechanism.  The 
file component uses a LockManager, but we have no distribtued implementation of 
it yet.

> Handle clustering of outbound endpoints using "persisted sequence numbering"
> ----------------------------------------------------------------------------
>
>                 Key: SM-1292
>                 URL: https://issues.apache.org/activemq/browse/SM-1292
>             Project: ServiceMix
>          Issue Type: New Feature
>          Components: servicemix-file
>    Affects Versions: 3.2.1
>            Reporter: Ron Gavlin
>
> The user should be able to configure the output file name as a pattern 
> including a "sequence number" (%{<seq_name>}) in the name, such that each 
> output file when written out to the target folder has a unique file name that 
> embeds the sequence number. The "persisted sequence number" is shared across 
> the cluster. See the "Persisted Sequence Number" section of document 
> http://wiki.open-esb.java.net/Wiki.jsp?page=FileBindingComponentClusteringSupportImplementation
>  for a description of how Sun's OpenESB File Binding Component supports this 
> requirement using a control file in the target directory.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to