Eventuous/eventuous

Persistent subscriptions are not invoking the FailureHandler

Closed this issue · 0 comments

Describe the bug
If you create persistent subscription with the configuration with FailureHandler settings, it's not being called, even using the ThrowOnError = true

To Reproduce
Steps to reproduce the behavior:

private static Task RetryEventProcessingFailureHandler(
		EventStoreClient client,
		PersistentSubscription subscription,
		ResolvedEvent resolvedEvent,
		Exception exception
	)
{
	return subscription.Nack(PersistentSubscriptionNakEventAction.Skip, exception.Message, resolvedEvent);
}
...
services.AddSubscription<AllPersistentSubscription, AllPersistentSubscriptionOptions>(
	"PaymentIntegration",
	builder => builder.Configure(cfg => 
	{
		cfg.FailureHandler = RetryEventProcessingFailureHandler;
		cfg.ThrowOnError = true;
		cfg.EventFilter = StreamFilter.RegularExpression($"^{testId}#");
	}));

Expected behavior
FailureHandler should be called.

Screenshots
I suspect the problem is in this part PersistentSubscriptionBase, the line 198, is if(Options.ThrownOnError) throw exception, and never calling the line 202 with the failureHandler.

image

Desktop (please complete the following information):
All

Smartphone (please complete the following information):
All

Additional context
Currently using 0.15.0-rc.2