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

Validate properties upon start up #436

Open
e-pettersson-ericsson opened this issue Feb 12, 2020 · 0 comments
Open

Validate properties upon start up #436

e-pettersson-ericsson opened this issue Feb 12, 2020 · 0 comments

Comments

@e-pettersson-ericsson
Copy link
Member

e-pettersson-ericsson commented Feb 12, 2020

Description

We need to validate that all mandatory properties are set (and with a correct value) upon starting up Eiffel Intelligence. Currently we don't check if a mail server is provided (or if it's configured correctly) or that the url to an event repository is provided.

We check these properties later but then it is "too late" to restart Eiffel Intelligence and configure with the right values since it will probably have received Eiffel events and triggered subscriptions etc..

What we have currently is either we have default values for properties, e.g. test.aggregation.enabled or we throw exceptions causing Eiffel Intelligence to crash.

If mandatory properties, e.g. rules.path or subscriptions.collection.name, are not provided Eiffel Intelligence crashes. The stacktrace contains details of Spring failing to create beans and nested IllegalArgumentException. It's not very intuitive or informative (unless you know where to look) to find out the reason for the crash.

Motivation

Instead of performing checks for every property when Eiffel Intelligence is already up and running attempt to use them (e.g. using url to event repository to perform upstream search) we check if all necessary properties were provided at once.

The error stacktrace is filled with implementation details and I would much rather have a better error message stating which property has not been provided.

Exemplification

I would like a better error message if some properties were not provided or if they are not in the correct format (String, int, booleans etc)

Eiffel Intelligence failed to start because **subscriptions.collection.name** was not provided! It can be any string ....

If they are not mandatory properties, e.g. event.repository.url is not provided EI can log that some functionality will not be enabled due to this.

event.repository.url was not provided! Eiffel Intelligence will not perform upstream searches for incoming Eiffel events...

Benefits

We check once if all mandatory properties are given, and avoid duplication of these checks later on in the code when Eiffel Intelligence is running...

Possible Drawbacks

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

1 participant