Patrik, I didn't find any API inside ConfigFactory to take list, but I found a workaround by just appending all my custom configuration as a String and use ConfigFactory.parseString(customizedConfigurationString) to generate Config
Thanks, Yan On Wednesday, May 25, 2016 at 12:07:15 AM UTC-5, Patrik Nordwall wrote: > > Try to use a java.util.List<String> as the value for the contact points > configuration. One address in each element of the list. I'm not sure if it > works. > > /Patrik > tis 24 maj 2016 kl. 23:35 skrev Yan Pei <yan...@gmail.com <javascript:>>: > >> I am trying to dynamically set up value for >> cassandra-journal.contact-points. >> >> If I am using ConfigFactory.parseString(). It works well. >> String name = "cassandra-journal.contact-points="; >> String contactPoints = name + "[ipaddress, ipaddres]"; >> Config overrides = ConfigFactory.parseString(contactPoints); >> Config actualConfig = overrides.withFallback(ConfigFactory.load()); >> ActorSystem system = ActorSystem.create("actor-system", actualConfig); >> >> But if I use Map, it complain about >> Failed to initialize CassandraSession. It will be retried on demand. >> Caused by: hardcoded v >> alue: contact-points has type STRING rather than LIST >> >> Map<String, Object> configurations = new HashMap<String, Object>(); >> String contactPoints = envHelper.getContactPoints(); >> configurations.put("cassandra-journal.contact-points", "[ipaddress, >> ipaddress]"); >> Config overrides = ConfigFactory.parseMap(configurations); >> Config actualConfig = overrides.withFallback(ConfigFactory.load()); >> ActorSystem system = ActorSystem.create("actor-system", actualConfig); >> >> >> I need to use Map since there are more than one thing I need to configure. >> >> How to resolve this issue? >> >> Thanks and Best Regards, >> Yan >> >> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ >> >>>>>>>>>> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to akka-user+...@googlegroups.com <javascript:>. >> To post to this group, send email to akka...@googlegroups.com >> <javascript:>. >> Visit this group at https://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.