繁体   English   中英

日志中的Masstransit Azure Service Bus 404错误

[英]Masstransit Azure Service Bus 404 errors in log

我正在将Masstransit与Azure Service Bus一起使用dotnet核心来处理一个传奇。 该应用程序的核心功能按预期工作,但是当尝试访问它创建的内部队列时,Masstransit的日志显示404错误。

记录的异常是:

Exception received on receiver: sb://MYSB.servicebus.windows.net/MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg?autodelete=300 during AcceptMessageSession
Microsoft.Azure.ServiceBus.MessagingEntityNotFoundException: Put token failed. status-code: 404, status-description: 
The messaging entity 'sb://MYSB.servicebus.windows.net/MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg' could not be found. 
TrackingId:1e0d96d2-b15f-413a-8453-cd924ad2595b_G31, SystemTracker:MYSB.servicebus.windows.net:MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg, Timestamp:2019-02-25T20:47:57.

ReceiveTransport Faulted: sb://MYSB.servicebus.windows.net/MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg?autodelete=300
System.AggregateException: One or more errors occurred. (One or more errors occurred. (Put token failed. status-code: 404, status-description: The messaging entity 'sb://MYSB.servicebus.windows.net/MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg' could not be found. TrackingId:1e0d96d2-b15f-413a-8453-cd924ad2595b_G31, SystemTracker:MYSB.servicebus.windows.net:MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg, Timestamp:2019-02-25T20:47:57.)) ---> System.AggregateException: One or more errors occurred. (Put token failed. status-code: 404, status-description: The messaging entity 'sb://MYSB.servicebus.windows.net/MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg' could not be found. TrackingId:1e0d96d2-b15f-413a-8453-cd924ad2595b_G31, SystemTracker:MYSB.servicebus.windows.net:MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg, Timestamp:2019-02-25T20:47:57.) ---> Microsoft.Azure.ServiceBus.MessagingEntityNotFoundException: Put token failed. status-code: 404, status-description: The messaging entity 'sb://MYSB.servicebus.windows.net/MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg' could not be found. TrackingId:1e0d96d2-b15f-413a-8453-cd924ad2595b_G31, SystemTracker:MYSB.servicebus.windows.net:MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg, Timestamp:2019-02-25T20:47:57.
   at Microsoft.Azure.ServiceBus.SessionClient.AcceptMessageSessionAsync(String sessionId, TimeSpan operationTimeout) in C:\source\azure-service-bus-dotnet\src\Microsoft.Azure.ServiceBus\SessionClient.cs:line 334
   at Microsoft.Azure.ServiceBus.SessionReceivePump.SessionPumpTaskAsync() in C:\source\azure-service-bus-dotnet\src\Microsoft.Azure.ServiceBus\SessionReceivePump.cs:line 125
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at MassTransit.Azure.ServiceBus.Core.Pipeline.MessageReceiverFilter.GreenPipes.IFilter<MassTransit.Azure.ServiceBus.Core.ClientContext>.Send(ClientContext context, IPipe`1 next)
   at MassTransit.Azure.ServiceBus.Core.Pipeline.MessageReceiverFilter.GreenPipes.IFilter<MassTransit.Azure.ServiceBus.Core.ClientContext>.Send(ClientContext context, IPipe`1 next)
   at GreenPipes.Agents.PipeContextSupervisor`1.GreenPipes.IPipeContextSource<TContext>.Send(IPipe`1 pipe, CancellationToken cancellationToken)
   at GreenPipes.Agents.PipeContextSupervisor`1.GreenPipes.IPipeContextSource<TContext>.Send(IPipe`1 pipe, CancellationToken cancellationToken)
   at GreenPipes.Agents.PipeContextSupervisor`1.GreenPipes.IPipeContextSource<TContext>.Send(IPipe`1 pipe, CancellationToken cancellationToken)
   at MassTransit.Azure.ServiceBus.Core.Transport.ReceiveTransport.<>c__DisplayClass13_0.<<Receiver>b__0>d.MoveNext()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. (Put token failed. status-code: 404, status-description: The messaging entity 'sb://MYSB.servicebus.windows.net/MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg' could not be found. TrackingId:1e0d96d2-b15f-413a-8453-cd924ad2595b_G31, SystemTracker:MYSB.servicebus.windows.net:MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg, Timestamp:2019-02-25T20:47:57.) ---> Microsoft.Azure.ServiceBus.MessagingEntityNotFoundException: Put token failed. status-code: 404, status-description: The messaging entity 'sb://MYSB.servicebus.windows.net/MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg' could not be found. TrackingId:1e0d96d2-b15f-413a-8453-cd924ad2595b_G31, SystemTracker:MYSB.servicebus.windows.net:MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg, Timestamp:2019-02-25T20:47:57.
   at Microsoft.Azure.ServiceBus.SessionClient.AcceptMessageSessionAsync(String sessionId, TimeSpan operationTimeout) in C:\source\azure-service-bus-dotnet\src\Microsoft.Azure.ServiceBus\SessionClient.cs:line 334
   at Microsoft.Azure.ServiceBus.SessionReceivePump.SessionPumpTaskAsync() in C:\source\azure-service-bus-dotnet\src\Microsoft.Azure.ServiceBus\SessionReceivePump.cs:line 125
   --- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.Azure.ServiceBus.MessagingEntityNotFoundException: Put token failed. status-code: 404, status-description: The messaging entity 'sb://MYSB.servicebus.windows.net/MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg' could not be found. TrackingId:1e0d96d2-b15f-413a-8453-cd924ad2595b_G31, SystemTracker:MYSB.servicebus.windows.net:MYCOMPNAME_dotnet_bus-_dkdyyybrsrcgyw19bdmjsapuyg, Timestamp:2019-02-25T20:47:57.
   at Microsoft.Azure.ServiceBus.SessionClient.AcceptMessageSessionAsync(String sessionId, TimeSpan operationTimeout) in C:\source\azure-service-bus-dotnet\src\Microsoft.Azure.ServiceBus\SessionClient.cs:line 334
   at Microsoft.Azure.ServiceBus.SessionReceivePump.SessionPumpTaskAsync() in C:\source\azure-service-bus-dotnet\src\Microsoft.Azure.ServiceBus\SessionReceivePump.cs:line 125<---
<---

该错误在应用程序启动后约5分钟开始,这似乎是该队列设置为自动删除时。 请注意,导致错误的队列不是我正在为应用程序中的传奇使用的队列,它似乎是由Masstransit中的内部进程创建的队列。

任何帮助原因或有关此队列用途的信息都将受到赞赏。

(编辑)配置:

    var bus = Bus.Factory.CreateUsingAzureServiceBus(cfg =>
    {
        // SetEntityNameFormatters

        var host = cfg.Host(
            new Uri(settings.HostAddress),
            h =>
            {
                h.TransportType = TransportType.AmqpWebSockets;
                h.RetryLimit = settings.RetryLimit;
                h.OperationTimeout = TimeSpan.FromSeconds(settings.TimeOutSeconds);
                h.TokenProvider =
                    TokenProvider.CreateSharedAccessSignatureTokenProvider(settings.KeyName,
                        settings.SharedAccessKey);
            });

        cfg.ConfigureDefaultSettings(queueSettings.Default);

        cfg.ReceiveEndpoint(host, $"{environment}.{queueSettings.Queue.Name}", e =>
        {
            e.ConfigureReceiverSettings(queueSettings.Queue);

            e.Saga<SagaConsumer>(serviceProvider);
            e.Consumer<SagaFaultConsumer>(serviceProvider);
            e.RemoveSubscriptions = true;
        });

        cfg.UseSerilog(Log.Logger);
        cfg.UseServiceBusMessageScheduler();
    });

    bus.Start();

ConfigureDefaultSettings和ConfigureReceiverSettings方法基于appsettings设置总线。 我当前的设置是:

  "AzureConnectionSettings": {
    "RetryLimit": 5,
    "TimeOutSeconds": 5
  },
  "QueueSettings": {
    "Default": {
      "RequireSession": true,
      "DuplicateDetection": {
        "Enabled": true,
        "HistoryTimeWindowMinutes": 5
      },
      "RetryPolicy": {
        "Type": "Exponential",
        "RetryLimit": 5,
        "MinIntervalSeconds": 1,
        "MaxIntervalSeconds": 10,
        "DeltaSeconds": 5
      }
    },
    "Queue": {
      "Name": "QueueName",
      "RequireSession": true
    }
  }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM