Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outbound Endpoint Health Check unable to serialize PingMessage when using Avro Serializer #201

Open
cookie-bytes opened this issue Jun 16, 2023 · 4 comments

Comments

@cookie-bytes
Copy link
Contributor

Hi

When using SerializeAsAvro and using AddOutboundEndpointsCheck() you get the following serialization exception:

System.InvalidCastException: Unable to cast object of type 'Silverback.Messaging.HealthChecks.PingMessage' to type 'Some.Business.Event.Type'

@cookie-bytes
Copy link
Contributor Author

cookie-bytes commented Jun 16, 2023

Could the PingMessage be added to Core to be used to handle the serialization differently, or does this need to stay in the HealthChecks namespace and package?

@BEagle1984
Copy link
Owner

I have to think about this because I'd gladly avoid bringing a dependency on Avro into the other packages.

I honestly don't know if it's worth investing in this health check since it proved to be impractical in many cases as it just clutters the topic and is detrimental to interoperability.

@cookie-bytes
Copy link
Contributor Author

This health check verifies the presence of all topic endpoints and the service’s ability to publish events to them using a Ping message.
If the outbox worker is used, I suppose the outbox health check can be relied upon instead of the outbound endpoint health check.
For services not using the outbox worker, error logs can be checked for producer error messages and this can be used to stop\restart the service if necessary.
Does that sound about right?

@BEagle1984
Copy link
Owner

Yes, exactly. For produce errors, we rely on the exception being thrown by the Publish / Produce methods. The caller can log it and monitor the logs to raise an alarm.
The downside is that you don't notice the issue until you try to produce and this might be a problem if you have for instance a service that only produces at night or during the weekend.

But having these ping messages polluting the topic is pretty ugly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants