Yes
(Write your steps here:)
Original exception logged and message retried or put on deadletter queue after retries
An additional exception is logged.
System.Private.CoreLib: Exception while executing function: ExecuteMessageConsumerAsync. MassTransit: The IErrorTransport was not available on the ReceiveContext.
The current issue is in our application code, but I could make a demo to try and reproduce if needed.
This is fixed, I think, in my latest changes for functions. I haven't pushed them to develop yet though. I completely rewrote it have a more consistent approach, however. So the code may need slight adjustment. That, and I can't seem to test ASB functions locally using the Function Core Tools (installed using homebrew on Mac).
A develop package should be available in an hour that may resolve this issue.
Great, I'll give it a try. Thanks for the quick response.
There are changes to the syntax to set it up, by the way. This is the updated sample code:
[FunctionName("SubmitOrder")]
public static Task SubmitOrderAsync([ServiceBusTrigger("input-queue")] Message message, IBinder binder, Microsoft.Extensions.Logging.ILogger logger,
CancellationToken cancellationToken)
{
var handler = binder.CreateBrokeredMessageReceiver(logger, cancellationToken, cfg =>
{
cfg.InputAddress = new Uri("sb://masstransit-build.servicebus.windows.net/input-queue");
cfg.UseRetry(x => x.Intervals(10, 100, 500, 1000));
cfg.Consumer(() => new SubmitOrderConsumer());
});
return handler.Handle(message);
}
Let me know if you get a chance to try it and verify it works. I couldn't get my function deployed to Azure to verify, so I'm shrugging. I really don't want to install Visual Studio, like, anywhere.
I'll test it out today and let you know.
Looks good, the error is gone. Thanks for your help.
There is one issue with the changes in 6.2. We were using the InMemerySendContext in a couple of unit tests. The class is no longer in MassTransit.Transports.InMemory.Contexts. Has it moved or is there a replacement?
[Test]
public void TestSendContextFilter_Should_Set_TenantId_Header()
{
// arrange
var pipe = Pipe.New<SendContext>(x =>
{
x.AddPipeSpecification(new TenantContextPipeSpecification<SendContext, int>(ProviderFactory, HeaderName));
});
var sendContext = new InMemorySendContext<A>(new A());
// act
pipe.Send(sendContext);
// assert
sendContext.Headers.GetAll()
.Should().Contain(x => x.Key == HeaderName)
.Which.Value.Should().Be(TenantId);
}
It's now MessageSendContext<T> - the InMemory version wasn't any different so I nix'd it.