I'm trying to autosubscribe, it is throwing error: System.ArgumentNullException: 'Value cannot be null. Arg_ParamName_Name'
here is my consumer code.
public class MyConsumer: IConsumeAsync<MyMessage>
{
public MyConsumer() {
}
public async Task ConsumeAsync(MyMessage message, CancellationToken cancellationToken = default)
}
here is my message code.
[Queue("QueueName", ExchangeName = "ExchangeName")]
public class MyMessage
{
public string? Val1{ get; set; }
}
this is how i am subscribing.
var bus = scope.ServiceProvider.GetRequiredService<IBus>();
var bus = scope.ServiceProvider.GetRequiredService<IBus>();
var subscriber = new AutoSubscriber(bus, "subsId_prefix");
subscriber.Subscribe(Assembly.GetExecutingAssembly().GetTypes());
I'm using .net 6 and EasynetQ version 6.0.1.