Search code examples
ibm-mqwebsphere-mq-fte

What happen if i trigger a transference in WebSphere MQ FTE but the folder is contantly receiving new files


I want to know what happen if i program a monitor to trigger a transference anytime a trigger file is found in x directory and transfer all the .txt files in x folder, what happen if this directory receive other files after the trigger file is created? are they send in the same transference? or will be send in another one?

Thanks for your help in advance


Solution

  • It depends on the timings between when the agent begins processing the transfer request submitted by the monitor and when the extra files are added to the directory that contains the source files to be transferred.

    As an example, let's say you monitor directory x to match on the trigger file, "trigger.file". When this file is detected by a poll of the resource monitor, it submits a managed transfer request to the agent that specifies "*.txt" as the source file located in directory x also. In other words, the managed transfer request submitted will transfer any file ending in .txt in directory x (because of the wildcard).

    Now, imagine the following timeline of events:

    • Two .txt files (file1.txt, file2.txt) are added to directory x.
    • The trigger file (trigger.file) is then subsequently created directory x.
    • The resource monitor polls, detects the file "trigger.file" which matches the resource monitors trigger conditions.
    • The resource monitor then submits a managed transfer request to the agent.
    • Before the agent processes this request, a new .txt file is added to directory x (file3.txt).
    • The agent then starts to process the managed transfer request and needs to expand the wildcard source file specification (*.txt) in a concrete list of files. So it lists directory x and picks out the files ending in .txt. At this point there are three files (file1.txt, file2.txt and file3.txt) that are included in the transfer, even though file3.txt was created after the resource monitor triggered when the trigger file was detected.

    Once the wildcard has been expanded and the concrete list of files determined, any new .txt file (e.g., file4.txt) will not be transferred until the trigger file is updated / replaced causing the resource monitor to trigger again.

    I hope this helps! If you need any further clarification, feel free to ask.