【问题标题】:Is it possible to have a list of files transferred after a successful transfer in WMQ-FTE?在 WMQ-FTE 中成功传输后是否可以传输文件列表?
【发布时间】:2012-06-05 19:57:49
【问题描述】:

我想在使用 WMQ-FTE 传输某些文件后将它们移动到带有时间戳的目录。我正在运行 v7.0.4.1。

我的问题是总是有新文件被写入我要转出的目录,所以只是盲目地转移所有内容不是办法。我还批量处理传输触发器,因为它们以大约 1000 个批次发生,因此每 1000 个要传输的文件只发生一次传输。

我希望有一些包含传输文件路径列表的元数据,这样我就可以在传输发生之前或之后将它们移动到一个目录中。目录创建将是 pre 或 post 源调用的一部分。

【问题讨论】:

    标签: ibm-mq file-transfer websphere-mq-fte


    【解决方案1】:

    看看DestinationTransferEndExit.java API documentation。特别是查看fileResults 参数。 ANT 任务可以使用此参数对特定文件执行操作。

    /**
     * Invoked immediately after the completion of a transfer on the agent acting as
     * the destination of the transfer.
     * 
     * @param transferExitResult
     *            a result object reflecting whether or not the transfer completed
     *            successfully.
     * 
     * @param sourceAgentName
     *            the name of the agent acting as the source of the transfer.
     * 
     * @param destinationAgentName
     *            the name of the agent acting as the destination of the
     *            transfer.  This is the name of the agent that the 
     *            implementation of this method will be invoked from.
     * 
     * @param environmentMetaData
     *            meta data about the environment in which the implementation
     *            of this method is running.  This information can only be read,
     *            it cannot be updated by the implementation.  The constants
     *            defined in <code>EnvironmentMetaDataConstants</code> class can 
     *            be used to access the data held by this map.
     * 
     * @param transferMetaData
     *            meta data to associate with the transfer.  The information can
     *            only be read, it cannot be updated by the implementation.  This 
     *            map may also contain keys with IBM reserved names.  These 
     *            entries are defined in the <code>TransferMetaDataConstants</code> 
     *            class and have special semantics.
     * 
     * @param fileResults
     *            a list of file transfer result objects that describe the source
     *            file name, destination file name and result of each file transfer
     *            operation attempted.
     * 
     * @return    an optional description to enter into the log message describing
     *            transfer completion.  A value of <code>null</code> can be used
     *            when no description is required.
     */
    String onDestinationTransferEnd(TransferExitResult transferExitResult,
                    String sourceAgentName,
                    String destinationAgentName,
                    Map<String, String>environmentMetaData,
                    Map<String, String>transferMetaData, 
                    List<FileTransferResult>fileResults);
    

    【讨论】:

    • 我没有指定这一切都必须发生在源服务器上,但是我找到了源传输的出口,SourceTransferEndExit.java。我将实施并报告我的发现
    猜你喜欢
    • 2013-07-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-30
    • 1970-01-01
    • 1970-01-01
    • 2013-05-25
    • 1970-01-01
    相关资源
    最近更新 更多