NService总线消息延迟问题

发布于 2024-09-24 10:25:54 字数 470 浏览 3 评论 0原文

昨天我做了一个生产模拟。结果不太好。两台服务器之间的连接正常。有时会有很大的延迟,大约5-10分钟。我发送一条消息,两个,三个……二十个,而另一方没有收到它们。然后繁荣,所有消息都在那里,回复已发送给发件人。另一种情况是当我发送10条消息时,对方立即收到并回复。但发件人没有收到回复。 5-10 分钟后,回复就到了。

这是怎么回事。请帮我。

====================
编辑: 两台服务器都是windows XP sp3。两台电脑都通过openVPN连接。 NSB 是最新版本。

UI <= 双工 => 应用程序服务器 <= 发布/订阅 => Denormalizer(只读数据库)

昨天我只测试了双工。在 1PC 环境中一切都很顺利。当双面打印准备好后,我将测试第三部分。

Yesterday I did a production simulation. The results where not good. The connection between the two servers is OK. From time to time there is huge delay, about 5-10 minutes. I send a message, two, three.. twenty and the other side do not receives them. And then boom, all messages are there and the reply is send to the sender. The other situation is when I send 10 messages, the other side receives them momentarily and replies. But the replies are not received by the sender. After 5-10 minutes BOOM, the replies are here.

What is goin on. please help me.

====================
EDIT:
Both servers are windows XP sp3. Both computers are connected with openVPN.
NSB is the latest version.

UI <= duplex => applicaiton server <= publish/subscribe => Denormalizer(readonly database)

Yesterday I tested only the duplex. In a 1PC environment everything goes smoothly. When the duplex is ready I will test the 3rd part.

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

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

发布评论

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

评论(1

提笔落墨 2024-10-01 10:25:54

您使用活动目录吗?我记得读过 AD 可能会导致 MSMQ 出现问题。类似于某些查找表巨大并且减慢速度的东西......无论如何记不清了,但只是一个想法。

否则,我建议从在一台计算机上安装两个端点开始,然后从那里开始工作。慢慢添加变量,直到再次中断。

编辑:尝试将此行添加到您的配置中:

.RunCustomAction(() => NServiceBus.Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(
                    mt => mt.SecondsToWaitForMessage, 2))

如果您使用主机,我不确定您如何配置它。我的配置如下:

    _Bus = NServiceBus.Configure.With()
                  .DefaultBuilder()
                  .Log4Net(new MyLogAppender())
                  .XmlSerializer()
                  .MsmqTransport()
                      .IsTransactional(true)
                      .PurgeOnStartup(true)
                  .UnicastBus()
                      .ImpersonateSender(false)
                      .DoNotAutoSubscribe()
                      .LoadMessageHandlers()
                  .RunCustomAction(() =>
                    NServiceBus.Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(
                    mt => mt.SecondsToWaitForMessage, 2))
                  .CreateBus()
                  .Start();

我有一个问题,我的 MSMQ 队列会定期超时,从而造成延迟。然而,默认超时仅以秒为单位(15 秒 iirc?)。一直无法弄清楚为什么会发生这种情况,我认为 MSMQ 库中存在一些有趣的事情。我真的怀疑同样的问题会导致 10 分钟以上的延迟,但值得一试。

Do you use active directory? I remember reading that AD can cause issues with MSMQ. Something along the lines of some lookup tables being huge and slowing down things... Anyway can't remember precisely, but just a thought.

Otherwise, I suggest starting with having both endpoints on 1 computer, and working from there. Slowly add variables until it breaks again.

EDIT: Try adding this line to your config:

.RunCustomAction(() => NServiceBus.Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(
                    mt => mt.SecondsToWaitForMessage, 2))

I'm not sure how you go about configuring this if you are using the host though. My config looks like:

    _Bus = NServiceBus.Configure.With()
                  .DefaultBuilder()
                  .Log4Net(new MyLogAppender())
                  .XmlSerializer()
                  .MsmqTransport()
                      .IsTransactional(true)
                      .PurgeOnStartup(true)
                  .UnicastBus()
                      .ImpersonateSender(false)
                      .DoNotAutoSubscribe()
                      .LoadMessageHandlers()
                  .RunCustomAction(() =>
                    NServiceBus.Configure.Instance.Configurer.ConfigureProperty<MsmqTransport>(
                    mt => mt.SecondsToWaitForMessage, 2))
                  .CreateBus()
                  .Start();

I have an issue where my MSMQ queues will timeout regularly, creating delay that way. However the default timeout is only in the seconds (15 seconds iirc?). Never been able to work out why it is happening, I think it is something funny in the MSMQ libraries. I really doubt the same issue would cause 10min+ delays, but it's worth a try.

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