ServiceStack RedisMessageQueueClient: 错误没有返回到ReplyTo地址,也没有使用RetryAttempts?

ServiceStack RedisMessageQueueClient: Errors are not returned to the ReplyTo address, nor is the RetryAttempts used?

我正在使用 RedisMessageQueueClient,如下所示:

    public TResponse SendSync<TRequest, TResponse>(TRequest request, int? timeoutMilliseconds = null)
        where TRequest : CoreRequest 
        where TResponse : CoreRequest
    {
        IMessage responseMessage = null;
        using (var mqClient = MqClientFactory.Instance.CreateMessageQueueClient())
        {
            // mqClient is ServiceStack.Messaging.RedisMessageQueueClient

            var uniqueCallbackQ = $"mq:c1:{request.GetType().Name}:{Guid.NewGuid():N}";
            var clientMsg = new Message<TRequest>(request)
            {
                ReplyTo = uniqueCallbackQ,
                RetryAttempts = 0
            };
    
            mqClient.Publish(clientMsg);
    
            TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMilliseconds.HasValue ? timeoutMilliseconds.Value : 120000);
    
            //Blocks thread on client until reply message is received
            responseMessage = mqClient.Get<TResponse>(uniqueCallbackQ, timeout);
    
            if(responseMessage?.Body == null)
            {
                throw new TimeoutException($"Request {request.GetType().Name} from {Assembly.GetEntryAssembly().GetName().Name} has timed out!");
            }
    
        }
        return responseMessage?.Body as TResponse;
    }

出于某种原因,在我的代码中产生了一个错误(这正是我实际试图找到的),根据 ,该错误应该返回到 ReplyTo 地址:

If you're using an explicit ReplyTo address any Errors will be sent to that ReplyTo address instead of the DLQ.

在这种情况下,我使用的是 ReplyTo,如下所示:

但是,当我浏览 Redis 时,我看到请求以 DLQ 结尾,而不是 ReplyTo 地址。在下图中,我们看到:

  1. ReplyTo地址已设置,与上述代码相同
  2. RetryAttempts 在代码中为 0,但在 DQL 转储中为 2;我还看到失败的请求被重新发送了 2 次。 MqServer 是使用 _mqServer = new RedisMqServer(_redisClientManager, retryCount: 2) 创建的,但我希望我可以使用上面的代码覆盖它?我也改成了_mqServer = new RedisMqServer(_redisClientManager, retryCount: 0),还是重试了两次

.NET 5.0,ServiceStack.Redis.Core 5.10.4,Visual Studio 2019

这里还是failed Error Responses are sent to the ReplyMq:

using (var mqFactory = appHost.TryResolve<IMessageFactory>())
{
    var request = new ThrowGenericError { Id = 1 };

    using (var mqProducer = mqFactory.CreateMessageProducer())
    using (var mqClient = mqFactory.CreateMessageQueueClient())
    {
        var requestMsg = new Message<ThrowGenericError>(request)
        {
            ReplyTo = $"mq:{request.GetType().Name}.replyto"
        };
        mqProducer.Publish(requestMsg);

        var msg = mqClient.Get<ErrorResponse>(requestMsg.ReplyTo, null);
        mqClient.Ack(msg);

        Assert.That(msg.GetBody().ResponseStatus.ErrorCode, Is.EqualTo("ArgumentException"));
    }
}

失败的响应会立即发送到 ReplyTo,即不会重试,因此不清楚您的 DLQ 消息来自何处。