NServiceBus简单重试机制,如何调试(基于AsyncPages示例)

发布于 2024-10-06 04:35:54 字数 2031 浏览 1 评论 0原文


我有一个用户注册的网站,我们需要通过肥皂网络服务调用将他们添加到遗留系统中。这些 Web 服务调用已排队等待异步重试... 我已从 NServiceBus 下载中复制了 AsyncPages 示例。

然而,消息似乎在没有被处理的情况下进出队列(它们也没有被放入错误队列中)。 (日志中显示的消息)

我的网站配置如下:

<UnicastBusConfig>
    <MessageEndpointMappings>
        <add Messages="FooComMessages" Endpoint="FooComSignupService"/>
    </MessageEndpointMappings>
</UnicastBusConfig>

我在按钮单击上有此测试代码:

Global.Bus.Send(new CreateMemberContractRequest[] 
                    {new CreateMemberContractRequest()
                        {birthdate = DateTime.Parse("4 oct 1975")}
                     }
                );

我的消息:

namespace FooComMessages
{
    [Serializable]
    public class CreateMemberContractRequest : IMessage
    {
        public DateTime birthdate { get; set; }
//.... snip....//
    }
}

我的处理程序配置:

  <MsmqTransportConfig InputQueue="FooComSignupService" ErrorQueue="FooComSignupServiceErrors" NumberOfWorkerThreads="1" MaxRetries="20" />
  <UnicastBusConfig>
    <MessageEndpointMappings>
      <add Messages="FooComMessages" Endpoint="FooComSignupService" />
    </MessageEndpointMappings>
  </UnicastBusConfig>

我的处理程序代码:

namespace FooComSignupService
{
    public class CreateMemberContractRequestHandler : IHandleMessages<CreateMemberContractRequest>
    {
        public IBus Bus { get; set; }
        private static readonly ILog Logger = LogManager.GetLogger(typeof(CreateMemberContractRequestHandler));
        public void Handle(CreateMemberContractRequest message)
        {
            Logger.Info("------------------------------------\nHandling CreateMemberContractRequest. id="+message.webdatabaseid);
            throw new NotImplementedException();
        }
    }
}

编辑: 我正在使用 NServiceBus.Host.exe 来托管 FooComSignupService

有谁知道我可能做错了什么? 我也无法在 Handle 方法中命中断点。

干杯。
默里.

Hi
I have a website where a user signs up we need to add them to a legacy system via a soap webservice call. these webservice calls are queue'd for retry asynchronously...
I have copied the AsyncPages sample from the NServiceBus download.

However the messages seem to flit in and out of the queue without being handled (nor are they put on the error queue). (the message shows in the journal)

my website is configured like so:

<UnicastBusConfig>
    <MessageEndpointMappings>
        <add Messages="FooComMessages" Endpoint="FooComSignupService"/>
    </MessageEndpointMappings>
</UnicastBusConfig>

And I have this test code on a button click:

Global.Bus.Send(new CreateMemberContractRequest[] 
                    {new CreateMemberContractRequest()
                        {birthdate = DateTime.Parse("4 oct 1975")}
                     }
                );

My message:

namespace FooComMessages
{
    [Serializable]
    public class CreateMemberContractRequest : IMessage
    {
        public DateTime birthdate { get; set; }
//.... snip....//
    }
}

My Handler Config:

  <MsmqTransportConfig InputQueue="FooComSignupService" ErrorQueue="FooComSignupServiceErrors" NumberOfWorkerThreads="1" MaxRetries="20" />
  <UnicastBusConfig>
    <MessageEndpointMappings>
      <add Messages="FooComMessages" Endpoint="FooComSignupService" />
    </MessageEndpointMappings>
  </UnicastBusConfig>

My Handler Code:

namespace FooComSignupService
{
    public class CreateMemberContractRequestHandler : IHandleMessages<CreateMemberContractRequest>
    {
        public IBus Bus { get; set; }
        private static readonly ILog Logger = LogManager.GetLogger(typeof(CreateMemberContractRequestHandler));
        public void Handle(CreateMemberContractRequest message)
        {
            Logger.Info("------------------------------------\nHandling CreateMemberContractRequest. id="+message.webdatabaseid);
            throw new NotImplementedException();
        }
    }
}

EDIT:
I'm using NServiceBus.Host.exe to host the FooComSignupService

Does anyone have any idea what I could be doing wrong?
I can't hit any breakpoints in the Handle method either.

Cheers.
Murray.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文