snowplow-incubator / common-streams

Other
1 stars 0 forks source link

Library should own default values for config objects #26

Closed istreeter closed 1 year ago

istreeter commented 1 year ago

This addresses something that was bothering me about who "owns" default values. The person implementing a snowplow application should not need to be an expert in what are the best config values for a specific source or sink. They might not know all the context of how the sources/sinks have been implemented and load tested. So the library should own the default values.

But I still want each value to be configurable in the app's own defaults and by the end user.

After this change, the application.conf file in snowplow applications can do things like this:

{
  input: ${snowplow.defaults.sources.kinesis}
  output: {
    good: ${snowplow.defaults.sinks.kinesis}
    bad: ${snowplow.defaults.sinks.kinesis}
  }
}

If a snowplow application really wants to override a particular value then it can do this in the application.conf file.

{
  input: ${snowplow.defaults.sources.kinesis}
  input: {
    appName: "some-loader"
  }
}