TIBCO ActiveMatrix Adapterfor Files (FA) publisher fails with error 'AEFA-000147 Service could not move data file'

TIBCO ActiveMatrix Adapterfor Files (FA) publisher fails with error 'AEFA-000147 Service could not move data file'

book

Article ID: KB0076375

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for Files for Unix and Windows -
Not Applicable -

Description

Description:
TIBCO ActiveMatrix Adapter for Files (FA) Publisher is used to publish input file content. In order to avoid publishing a partial input file, we need to ensure that the file should be processed after it is successfully written by other third party systems. We can configure the FA publisher with a recognition method as By Trigger. Once another third party system completely writes the file, we need to notify FA to start publishing the input file by creating a trigger file. There may be a case where we do not have control on other third party systems or we can not integrate a notify mechanism at the other third party system level, so we need to implement a logic to notify the FA publisher.


Symptoms:

When a TIBCO ActiveMatrix Adapter for Files (FA) publisher starts publishing a partial input file, ( a file is currently used/locked by another third party system) FA throws the following error.

 

***
Error [Adapter] AEFA-000147 
Service could not move data file input.txt from input directory \input to working directory \working/.  Data file was not processed!
***

Cause:
Third party application locks the file while writing, and at the same time TIBCO ActiveMatrix Adapter for Files (FA) publisher tries to move that input file from the input directory to the working directory to process the input file data. The FA publisher then throws the error.

Issue/Introduction

TIBCO ActiveMatrix Adapterfor Files (FA) publisher fails with error 'AEFA-000147 Service could not move data file'

Environment

Product:TIBCO ActiveMatrix® Adapter for Files (Unix/Win) Version: 6.2.x OS: All Supported Operating Systems --------------------

Resolution

Requirement to implement logic which can detect when a third party application has completed processing a file and notify TIBCO ActiveMatrix Adapter for Files (FA) to publish a particular file. Refer to the attachment (Filename: FABWPOC.zip) having POC for the following possible solutions.

1). Use File Poller to Notify FA.

This Solution will work if your third party application writes data to an input file and saves the input file once the file is completely written. Once the file is written, the third party application will save the file. As the TIBCO BusinessWorks (BW) process is configured to track the file modified event on the input file, it will trigger FA to start publishing the file.

 Data Flow.

Input File saved by third party app --> File poller> Create trigger file --> FA publisher published file

For details, refer to Process Definition (File Poller) in attached POC code.

2). Use a timer. HERE

You can have a timer activity scan the input directory and check whether the third party application writes data to the input file. If the third party application is writing data to the file, then the file will be locked and it will not allow a rename modification.  Try to rename the file to check if the file is locked. If the file is not locked, create a trigger file to notify the FA to publish a particular input file.

Data Flow.

timer > check if file locked >Create trigger file for completed files--> FA publisher published  file.

For details, refer to the Process Definition (Timer) in attached POC code.

In both of the above cases we have created a trigger file to notify the FA publisher to publish the input file. You can use a JMS topic publisher as well to notify a FA publisher to publish an input file. There is another variant solution such as changing the file adapter directory at run time, but it will need again or using non-TIBCO shell or Java script to identify that the file is locked by rename or any other activity.

Note that the samples provided (attached) are for demonstration purposes. You will need to customize and test in your environment.