BizTalk NSoftware SFTP - 仅在收到第二个文件时读取第一个文件

发布于 2024-12-31 22:35:49 字数 1605 浏览 5 评论 0原文

我有一个场景,客户端删除 XML 和 .FINISHED 文件。客户端在完成写入 XML 文件后创建 .FINISHED 文件。两个文件具有相同的名称。正如您所看到的,我无法在创建 .FINISHED 之前开始读取 .XML。将 XML 复制到目标后,我喜欢从客户端位置删除这两个文件。

它看起来非常典型的问题,但我认为 SFTP 和 SSO 使它变得不典型。

我正在 BizTalk 2009 上使用 /n 软件 SFTP Adapter for BizTalk 进行开发,并使用 SSO 进行身份验证。

注意:

  • 我必须使用 SFTP,因为我无法使用 FTP 协议。

  • 我在 Google 上搜索并尝试过一些解决方案,但都是 FTP 基于和/或使用相关性。

  • 我必须使用 SSO 来管理凭据。

  • 软件 SFTP 适配器提供了使用 SSO 的功能,并且在正常情况下工作正常,我必须读取/写入而无需等待 .FINISHED 文件。

我使用了以下方法:

相关性 - 并行/顺序

  • 花了一些时间后,我意识到我不能使用相关性,因为我 在开始读取 .XML 之前必须等待 .FINISHED 文件。客户 首先开始编写 XML,然后完成

  • 当我删除 .XML 接收位置时,会选择文件,而无需等待 .FINISHED 并通过异常进行编排,具体取决于 根据情况。

    对于这个解决方案,我从以下博客获得了帮助

    http://www.paulvanbrenk.com/blog/CategoryView,category, BizTalk.aspx

如果我的理解有误,请指正。

收到 .FINISHED 后,使用 .Net 组件从 SFTP 位置获取 XML 文件:

另一种可能的解决方案 是在运行时更改软件或任何其他 SFTP 适配器在编排内的接收位置或 URI,即最初将其设置为 .FINISHED,一旦接收,请将其更改为.XML 并获取它。

不知道如何实现它,但在编排中可能吗?

I have a scenario where client drop an XML and a .FINISHED file. Client create the .FINISHED file once it’s finishes writing XML file. Both file have same name. As you can see, I can’t start reading .XML before .FINISHED created. Once XML copied to target I like to delete both files from the client location.

It looks very typical problem but I think SFTP and SSO have made it non-typical.

I am developing on BizTalk 2009 using /n software SFTP Adaptor for BizTalk with SSO for authentication.

Notes:

  • I have to use SFTP as I can’t use FTP protocol.

  • There are some solutions I have Googled and tried but all are FTP
    based and/or using Correlation.

  • I have to use SSO for managing credentials.

  • software SFTP Adaptor provides the feature to use SSO and it is working fine under normal scenario where I have to read/write without waiting for .FINISHED file.

I have used following approaches:

Correlation – Parallel/Sequential

  • After spending some time I realised that I can’t use Correlation as I
    have to wait for .FINISHED file before start reading .XML. Client
    starts writing XML first and then FINISHED

  • When I drop the .XML receive location picks the file without waiting for .FINISHED and Orchestration through exception depending
    upon situation.

    For this solution I have got help from following blog

    http://www.paulvanbrenk.com/blog/CategoryView,category,BizTalk.aspx

Please correct me if I have wrong understanding.

Using a .Net Component to Get the XML File from SFTP location once .FINISHED received:

Another possible solution is to change Software or any other SFTP Adaptor’s receive location or URI within Orchestration at runtime i.e. initially set it to .FINISHED once received change it to .XML and get it.

Don’t know how to achieve it but is it possible within orchestration??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心如狂蝶 2025-01-07 22:35:49

/nsoftware SFTP 适配器的另一个选项是使用 MonitorFileGrowth 设置。

这会记录轮询间隔之间的文件大小,并且在文件停止增加之前不会尝试下载文件(因此不再写入文件)。您可以在适配器的其他属性中设置它,例如:

MonitorFileGrowth=true

或者,如果您可以控制在服务器上创建文件的过程,则使用与您的 FileMask 不匹配的文件的临时扩展名(因此接收位置不会尝试下载它)也可以。

或者,如果您想像 Fabio 所说的那样等待 .FINISHED 文件,您可以将接收位置配置为仅查找 .FINISHED 文件,一旦在编排中接收到,就使用发送适配器按照本文下载 XML 文件:< a href="http://www.nsoftware.com/kb/showentry.aspx?entry=09170901" rel="nofollow">http://www.nsoftware.com/kb/showentry.aspx?entry=09170901

Another option with the /nsoftware SFTP adapter is to use the MonitorFileGrowth setting.

This records the size of a file between polling intervals and won't try to download the file until it has stopped increasing (so the file is no longer being written to). You can set it in the Other property of the adapter like:

MonitorFileGrowth=true

Or if you have control over the process that creates the files on the server using a temporary extension for the file that doesn't match your FileMask (so the receive location won't try to download it) would also work.

Or if you want to wait for the .FINISHED file like Fabio said, you could configure the receive location to only look for .FINISHED files, and once received in your orchestration use the send adapter to download the XML file as per this article: http://www.nsoftware.com/kb/showentry.aspx?entry=09170901

挽你眉间 2025-01-07 22:35:49

为什么不将接收位置设置为仅在以 .FINISHED 结尾的文件上激活。然后编写您的编排来获取相应的 XML 文件 - 这可行吗?

Why don't you set your receive location to only activate on files that end in .FINISHED. Then write your orchestration to go and fetch the corresponding XML file - could that work?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文