Describe the bug
Handlers can't react to Marten.IEvent<T> messages when the endpoint is configured to be durable since Marten.IEvent<T> is not serializable.
To Reproduce
Integrate Wolverine with Marten; it doesn't matter whether you use .EventForwardingToWolverine or .PublishEventsToWolverine.
Declare a Wolverine handler that reacts to a Marten.IEvent<T>, e.g.:
public static class SomeHandler
{
public static object Handle(IEvent<SomeEvent> martenEvent)
{
Console.WriteLine(martenEvent.StreamKey);
}
}
Configure the relevant endpoint to be durable, e.g. options.Policies.UseDurableLocalQueues()
Append the Marten event, T, to an event stream.
Expected behaviorSomeHandler executes and outputs the stream key.
Actual behavior
Serialization of Marten.IEvent<T> fails with the following exception:
System.NotSupportedException: Serialization and deserialization of 'System.Type' instances is not supported. Path: $.EventType.
Describe the bug Handlers can't react to
Marten.IEvent<T>
messages when the endpoint is configured to be durable sinceMarten.IEvent<T>
is not serializable.To Reproduce
.EventForwardingToWolverine
or.PublishEventsToWolverine
.Marten.IEvent<T>
, e.g.:options.Policies.UseDurableLocalQueues()
T
, to an event stream.Expected behavior
SomeHandler
executes and outputs the stream key.Actual behavior Serialization of
Marten.IEvent<T>
fails with the following exception:System.NotSupportedException: Serialization and deserialization of 'System.Type' instances is not supported. Path: $.EventType.