Fail Fast on Pub/Sub Misconfiguration in GoFr CLI Applications
This can also be extended for other dependencies
Description
When creating a GoFr CLI application, the server may still start even if Pub/Sub is misconfigured. Because of custom recovery logic, the app continues running silently, which hides the underlying issue.
This can cause situations where Pub/Sub functionality does not work as expected, but the developer is unaware because no failure is reported during startup.
To improve developer experience and reliability, the GoFr CLI application should fail fast on Pub/Sub misconfiguration, making the issue immediately visible.
Expected Behavior
- During startup, validate Pub/Sub configuration (e.g., credentials, endpoints, required topics/subscriptions).
- If validation fails, log a clear error and stop the application with a non-zero exit code.
- CLI apps should not run in a degraded state where Pub/Sub is unavailable.
Benefits
- Prevents silent runtime failures in CLI apps.
- Surfaces misconfigurations early during development or deployment.
- Improves confidence in GoFr apps by ensuring dependencies are correctly set before running.
Suggested Implementation
- Perform connection/auth checks before application starts.
- If validation fails, stop execution and provide actionable error messages.
@aryanmehrotra , In case of PubSub ...Pubsub connections are retried. Hence we can't fail fast. A more generalised solution needs to be proposed.