Describe the bug
When producing an event, System.InvalidOperationException: '"Can not start an Activity that was already started"' is thrown (and immediately swallowed) by System.Diagnostics.DiagnosticSource.dll!System.Diagnostics.Activity.NotifyError(System.Exception exception).
The reason is that in BaseProducer.Produce, we explicitly call act?.Start(), but the activity has already been started by the previous line's call to ProducerActivity.Start.
Describe the bug When producing an event,
System.InvalidOperationException: '"Can not start an Activity that was already started"'
is thrown (and immediately swallowed) bySystem.Diagnostics.DiagnosticSource.dll!System.Diagnostics.Activity.NotifyError(System.Exception exception)
.The reason is that in BaseProducer.Produce, we explicitly call
act?.Start()
, but the activity has already been started by the previous line's call to ProducerActivity.Start.https://github.com/Eventuous/eventuous/blob/b72c9c0d9115c4a25572e6277c54a940e4b5b9b0/src/Core/src/Eventuous.Producers/BaseProducer.cs#L46-L47
To Reproduce Steps to reproduce the behavior:
System.InvalidOperationException
in Visual Studio's Exception SettingsRabbitMqProducer
Expected behavior No exception should be thrown.
I can provide a PR if you want. As far as I can understand, simply changing https://github.com/Eventuous/eventuous/blob/b72c9c0d9115c4a25572e6277c54a940e4b5b9b0/src/Core/src/Eventuous.Producers/BaseProducer.cs#L47 to
return (act, new[] { producedMessage });
should be enough.