Questions tagged [typesafe-config]

Typesafe-config is a configuration reading library written by Typesafe.com in Java.

Lightbend Config is a configuration reading library written by Lightbend (formerly known as Typesafe) in Java. It supports HOCON, a JSON superset optimized for succinctly expressing configuration.

214 questions
41
votes
2 answers

Scala: Write value to typesafe config object

I'm using Typesafe config & have a config file in my resources directory which looks like this: something { another { someconfig=abc anotherconfig=123 } } How would I change the value of anotherconfig using scala?
goo
  • 2,060
  • 3
  • 27
  • 48
29
votes
6 answers

No configuration setting found for key 'akka.version'

I am learning akka-remoting and this is how my project looks The project structure looks like …
daydreamer
  • 73,989
  • 165
  • 410
  • 667
28
votes
1 answer

Merging multiple TypeSafe Config files and resolving only after they are all merged

I am writing test code to validate a RESTful service. I want to be able to point it at any of our different environments by simply changing an environment variable before executing the tests. I want to be able to merge three different config…
John Arrowwood
  • 1,957
  • 2
  • 16
  • 25
26
votes
9 answers

No configuration setting found for key typesafe config

Im trying to implement a configuration tool typesafehub/config im using this code val conf = ConfigFactory.load() val url = conf.getString("add.prefix") + id + "/?" + conf.getString("add.token") And the location of the property file is …
MIkCode
  • 2,185
  • 4
  • 23
  • 41
20
votes
4 answers

Spring Environment backed by Typesafe Config

I want to use typesafe config (HOCON config files) in my project, which facilitate easy and organized application configuration. Currently I am using normal Java properties file(application.properties) and which is difficult to handle on big…
Ysak
  • 2,073
  • 4
  • 22
  • 45
20
votes
2 answers

How to add configuration file to classpath of all Spark executors in Spark 1.2.0?

I'm using Typesafe Config, https://github.com/typesafehub/config, to parameterize a Spark job running in yarn-cluster mode with a configuration file. The default behavior of Typesafe Config is to search the classpath for resources with names…
MawrCoffeePls
  • 692
  • 1
  • 5
  • 14
15
votes
0 answers

Typesafe/Hocon config: variable substitution: reference path

We have a project with huge configuration files built using hocon configs. There is an intention to use variables where possible to create template_section and setup some values in template based on some options. The problem is that while using…
vvg
  • 6,075
  • 14
  • 32
15
votes
3 answers

Overriding multiple config values in Typesafe config when using an uberjar to deploy

I've an Akka application which uses multiple configuration values (IP address, port numbers) defined in resource/application.conf. I'm using the sbt-assembly plugin to create an uber jar and then deploying this jar. Is there a way to override the…
Soumya Simanta
  • 10,777
  • 23
  • 95
  • 153
12
votes
2 answers

How can I fix missing conf files when using shadowJar and Scala dependencies?

Writing this for users who have future issues like me. Libraries that are built on the Typesafe config typically use their own reference.conf files and refer to certain configuration keys. When building a fat JAR using the Gradle shadowJAR plugin,…
crockpotveggies
  • 11,654
  • 11
  • 65
  • 127
12
votes
0 answers

typesafe config substitution for relative paths

Is there a way to use relative paths in substitution instead of absolute ones? I want to write this, which doesn't work: service { password = "qwerty" url = "http://example.com?user=John&password="${password} } Works only this case: service { …
Yaroslav
  • 3,897
  • 4
  • 21
  • 32
12
votes
1 answer

How print akka configuration at startup?

I have a akka project with several config files. Is it possible to print akka merged configuration event when application starts (or stops) with errors?
Cherry
  • 25,428
  • 40
  • 160
  • 286
11
votes
1 answer

Role of `?` when accessing environment variables in HOCON files

The docs say that I can access environment variables like this: database_name = "${?DB_NAME}" Where DB_NAME is an environment variable. Do I have to put the question mark ? or is that there to prevent a crash if it doesn't exist? Also, are we…
Blankman
  • 236,778
  • 296
  • 715
  • 1,125
11
votes
3 answers

Case Class Instantiation From Typesafe Config

Suppose I have a scala case class with the ability to serialize into json (using json4s or some other library): case class Weather(zip : String, temp : Double, isRaining : Boolean) If I'm using a HOCON config file: allWeather { BeverlyHills { …
Ramón J Romero y Vigil
  • 15,664
  • 4
  • 61
  • 93
10
votes
1 answer

What is a good way to implement reloading of a Typesafe config

In a Scala application that is using Typesafe Config, I want to add the possibility to reload a Config at runtime. A Config instance is immutable. Here is what I have so far: package config trait Settings { private[config] var config: Config =…
reikje
  • 2,474
  • 2
  • 19
  • 35
9
votes
2 answers

Typesafe config: encryption/obfuscation of sensitive values in memory

I have an Akka project that needs several passwords to work: to access a datastore, a distributed filesystem connection string... Those values are not hardcoded in the configuration file, but rather pulled from a key vault at run time during app…
CanardMoussant
  • 773
  • 6
  • 20
1
2 3
14 15