NService bus message delay problem

前端 未结 1 856
醉酒成梦
醉酒成梦 2021-01-24 02:46

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 s

相关标签:
1条回答
  • 2021-01-24 03:05

    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.

    0 讨论(0)
提交回复
热议问题