reactive-interaction-gateway
reactive-interaction-gateway copied to clipboard
Handling disconnecting service that is configured in SUBMISSION_CHECK
I am currently migrating my project to use SSE in favor of REST and RIG as a middleman plays exceptionally well in this mix. Thanks for the efforts!
I use the SUBMISSION_CHECK variable to point to my AuthService to authorize cloud events before sending 2xx or otherwise back to RIG.
When any of my services go down (restart, crash, docker container updates) they send a cloud event so connected clients are notified that a service is currently not available. This works perfectly well except when the AuthService itself goes down.
What happens is that the AuthService sends the "i am going down" cloud event to RIG, goes down but RIG then wants to check the request against the url in SUBMISSION_CHECK - which is of course the just crashed/restarting service that now returns a network connection error, hence the submission is being denied and clients don't get the information.
Is there a way to configure for example jwt_validation as submission check action for just a particular cloud event so that those requests are not circled back to the configured URL in SUBMISSION_CHECK? Or is there a much better process so obvious I simply missed it. I know it's an edge case and I could (and do) handle subsequent network errors on the client side but sending the information that AuthService is down via SSE instantly to clients would be optimal.
Greets -act
Hi, thanks for opening the issue. Indeed, I haven't really thought about this scenario yet. One way to deal with this is to disable the submission auth check for the internal port. This could make sense but I'm a little bit worried people might be surprised when they find out that SUBMISSION_CHECK only applies to the external /_rig/v1/events but not to the internal /v1/messages... @mmacai what do you think?