BizTalk 组中的多个 BizTalk 服务器 - 如何处理并发?

发布于 2024-08-20 07:10:27 字数 354 浏览 16 评论 0原文

我目前负责建立多环境 BizTalk 部署,我们计划在 BizTalk 组中部署两个或更多 BizTalk Server 以提供高可用性和可扩展性。

我们现在关心的是如何处理 WCF SQL 和文件适配器等适配器的并发性,因为对于 SQL 适配器,两个 BizTalk 接收主机可能会继续轮询同一个数据库表。

最初我对 SQL 的想法是使用锁定提示,但我不确定是否还有其他问题或是否有任何其他经过验证的解决方案。

对于文件适配器我所知道的是可以设置接收适配器在处理期间更改文件的文件名,以便其他 BizTalk 主机将避免拾取该文件,但我不太确定此解决方案是否足以处理并发。

我将不胜感激任何帮助/建议。

非常感谢

I'm currently responsible for putting up a multi environment BizTalk Deployment and we're planning on deploying two or more BizTalk Server in a BizTalk Group to provide High Availability and Scalability.

Our concern now is how to handle concurrency for adapters like WCF SQL and File Adapters because it is likely possible for example for SQL Adapter that two BizTalk Receive host will keep on polling on the same DB table.

Initially my idea for SQL is employ locking hints but i'm not really sure if there's any other concern on this or if there's any other proven solution.

For File Adapter What I know is it's possible to set the receive adapter to change the filename of the file during processing so that other BizTalk host will avoid picking up the file yet I'm not very sure if this solution is enough already to handle concurrency.

I would appreciate any help / suggestions.

Many Thanks

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

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

发布评论

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

评论(3

谜兔 2024-08-27 07:10:27

一般来说,大多数 BizTalk 适配器都会开箱即用地避免竞争条件。

例如,BizTalk 文件适配器已实现文件锁定,因此不同主机上的文件适配器的多个实例将不会读取同一文件。

文件重命名功能的用法解释如下(来自 MSDN 文档

您还可以配置文件
接收适配器重命名文件时
处理它们。你应该重命名
文件以确保接收
适配器不生成重复项
消息,如果接收位置是
关闭并重新启动

有多个适配器在多个实例上运行时并不安全。其中包括(但可能还有其他)轮询场景中的 POP3、FTP、MSMQ/MSMQT 和数据库适配器。

对于这些适配器,您可以使用群集主机的 BizTalk 功能。有一篇文章这里解释了集群主机。这是确保 SQL 轮询不会产生重复项的最简单方法。如果需要,您还可以在 SQL 级别实现此目的。

除此之外,您将真正了解业务流程的细节,并且需要针对每种情况进行设计。例如,如果源系统两次提供同一个文件,会发生什么情况?

有关此主题的更多信息,请参阅以下两篇 SO 帖子:

BizTalk - 接收端口从数据库读取两次

网络负载平衡 Biztalk 实例< /a>

In general most BizTalk adapters will avoid race conditions for you out of the box.

For example, the BizTalk file adapter already implements file locking so multiple instances of the file adapter on different hosts will not read the same file.

The usage of the file rename feature is explained below (From the MSDN documentation)

You can also configure the file
receive adapter to rename files when
processing them. You should rename
files to ensure that the receive
adapter does not generate duplicate
messages if the receive location is
shut down and restarted

There are several adapters that are not safe when run on multiple instances. These include (but there may be others) the POP3, FTP, MSMQ/MSMQT and Database adapters in polling scenarios.

For those adapters you can use the BizTalk feature of clustered hosts. There is a post here explaining the usage and configuration of a clustered host. This is the easiest way to ensure your SQL polling will not produce duplicates. You can also achieve this at the SQL level if you need to.

Beyond that you are really getting into the specifics of business processes and you will need to design for each case. For example - what happens if the same file is provided twice by a source system?

See the two following SO posts for some more information around this subject:

BizTalk - Receive Port reading twice from DB

Network Load Balancing Biztalk Instances

木槿暧夏七纪年 2024-08-27 07:10:27

感谢您的回答和您提供的链接。实际上我已经阅读了其中的一些,并且我还能够对这些解决方案进行一些测试。
对于 SQL 适配器,BizTalk 主机群集被证明是一个很好的解决方案,但会导致您无法最大化 BizTalk 组(主机冗余)的优势以实现可扩展性。因此,出于这个原因,我们决定避免使用集群解决方案,但对于真正需要集群来实现高可用性的 MessageBox。
我们想要实现的是通过 BizTalk Server 组实现 Active/Active 或者我应该说负载平衡,这意味着我们实际上将有多个 SQL 接收适配器同时轮询。
最初我的解决方案是在查询级别通过锁定提示来处理它,下面是我的 SP 示例。

MERGE INTO EmployeeComp
USING (SELECT EmployeeID
FROM
[AdventureWorks].[dbo].[EmployeeComp] 
WITH (READPAST, UPDLOCK) 
WHERE
[AdventureWorks].[dbo].[EmployeeComp].[Status] = 0) e(EmployeeID)
 ON EmployeeComp.EmployeeID = e.EmployeeID
WHEN MATCHED THEN
 UPDATE SET
 STATUS = 2

OUTPUT Inserted.EmployeeID, Inserted.Name, Inserted.Status;

您能给我创建的 SP 一些反馈吗?我做了几次测试,BizTalk WCF-SQL 适配器读取了大约 500,000 个数据,然后同时写入了另外数千个数据,事实证明它的工作符合我的预期。

虽然解决方案似乎不错,但我还不确定对这种解决方案有什么影响,也许您也可以告诉我一些信息?

我还想是否可以使用本文中的 SQL Server Service Broker。 http://blogs.msdn.com/adapters/archive/2008/06/30/using-the-wcf-sql-adapter-to-read- messages-from-ssb-queues-and-submit-them-to-biztalk.aspx

现在我仍在检查它,但不确定是否可以解决这个问题。

非常感谢

Thank you for the answer and the links you have provided. Actually I’ve read already some of them and I was also able to do some testing regarding those solutions.
For SQL adapter, BizTalk Host clustering proves to be a good solution but will cause you not to maximize the advantage of BizTalk Group (Host redundancy) for scalability purpose. So for that reason we've decided we're going to avoid the clustering solution but for MessageBox which really need the clustering for High Availability.
What we’re trying to accomplish is having an Active / Active or shall I say Load Balancing by means of BizTalk Server Group which means we are really going to have several SQL receive adapter polling simultaneously.
Initially my solution was in query level handling it thru locking hints, below is sample of my SP.

MERGE INTO EmployeeComp
USING (SELECT EmployeeID
FROM
[AdventureWorks].[dbo].[EmployeeComp] 
WITH (READPAST, UPDLOCK) 
WHERE
[AdventureWorks].[dbo].[EmployeeComp].[Status] = 0) e(EmployeeID)
 ON EmployeeComp.EmployeeID = e.EmployeeID
WHEN MATCHED THEN
 UPDATE SET
 STATUS = 2

OUTPUT Inserted.EmployeeID, Inserted.Name, Inserted.Status;

Can you give some feedback with the SP I’ve created? I did several testing with around 500,000 data being read by BizTalk WCF-SQL adapter and then at the same time another thousands of data being write and it prove to be working as what I expected.

Although solution seems to be fine but I’m not yet sure what are impacts on this kind of solution, maybe you can shed me some light with this also?

Also I was thinking if it’s possible to use SQL Server Service Broker from this article. http://blogs.msdn.com/adapters/archive/2008/06/30/using-the-wcf-sql-adapter-to-read-messages-from-ssb-queues-and-submit-them-to-biztalk.aspx

Right now I’m still checking with it and not yet sure if how possible to work this out.

Many Thanks

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