-
-
Notifications
You must be signed in to change notification settings - Fork 279
Closed
Milestone
Description
When using wolverine redis transport, the schedule async method throws the following exception.
System.ArgumentOutOfRangeException: The value needs to translate in milliseconds to -1 (signifying an infinite timeout), 0, or a positive integer less than or equal to the maximum allowed timer duration. (Parameter 'delay')
Following is the code to recreate the issue.
using Wolverine;
using Wolverine.Redis;
var builder = WebApplication.CreateBuilder(args);
builder.UseWolverine(opts =>
{
opts.UseRedisTransport("localhost:6379").AutoProvision()
.ConfigureDefaultConsumerName((runtime, endpoint) =>
$"{runtime.Options.ServiceName}-test-{runtime.DurabilitySettings.AssignedNodeNumber}");
opts.PublishAllMessages().ToRedisStream("wolverine-messages");
opts.ListenToRedisStream("wolverine-messages", "test-consumers")
.StartFromNewMessages();
});
var app = builder.Build();
app.MapPost(
"/test-command", async (TestCommand command, IMessageBus bus) =>
{
await bus.ScheduleAsync(command, TimeSpan.FromSeconds(5));
return Results.Ok();
});
app.Run();
public record TestCommand(string message);
public class TestCommandHandler
{
public void Handle(TestCommand command) => Console.WriteLine(
$"Handled command with message: {command.message}");
}
Metadata
Metadata
Assignees
Labels
No labels