A better way to load configuration of certain types with PureConfig in Scala

Knoldus

Hello Folks, Hope you all are doing good !!!

In this blog we will discuss about the better way of loading the configuration of certain types. Now a days we use typesafe config for the same purpose. PureConfig also uses typesafe config internally but also provides the better way of doing this.

PureConfig is not a configuration library, it can be seen as a better front-end for the existing libraries. It uses the Typesafe Config library for loading raw configurations and then uses the raw configurations to do its magic.

The goal of PureConfig is to create at compile-time the boilerplate necessary to load a configuration of a certain type. In other words, you define what to load and PureConfig provides how to load it.

To use the PurConfig, we need to add dependency in build.sbt for scala 2.11, 2.12:

Now define the config in application.conf file :

You can…

View original post 99 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s