Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Alternative command line friendly syntax for string list #69

Closed
patriknw opened this Issue · 11 comments

4 participants

@patriknw
Owner

We have the need to override string lists from command line -D parameters. That is not possible at the moment.
Example: akka.cluster.seed-nodes=["akka.tcp://TestApp@host1:2552", "akka.tcp://TestApp@host2:2552"]

That gives error: ConfigException$WrongType: system properties: akka.cluster.seed-nodes has type STRING rather than LIST

Some kind of alternative syntax would be nice.

As discussed the following syntax would be ok:
-Dakka.cluster.seed-nodes.0=akka.tcp://TestApp@host1:2552 -Dakka.cluster.seed-nodes.1=akka.tcp://TestApp@host2:2552

@slandelle

Sorry to jump in.
Wouldn't it be better to support comma separated values?
-Dakka.cluster.seed-nodes=akka.tcp://TestApp@host1:2552,akka.tcp://TestApp@host2:2552

@havocp
Owner

There are a few problems with having syntax within the string rather than having distinct strings:

  • there are usually 2-3 layers of quoting (shell, properties file, the syntax)
  • it's a syntax to document/learn/implement (how do you escape a comma?)
  • you would get syntax errors rather than type errors when there's an actual type error, which could be confusing

We could also just support a JSON array syntax, but it would have a similar issue.

@slandelle

OK, got it, thanks!

@havocp
Owner

Thanks for the comment though, I am not sure we have the perfect solution here yet, this is just the idea we have so far.

@patriknw
Owner

Hi @havocp, have you thought any more about this? Is it possible to complete the remaining things and release a new minor version?

@havocp
Owner

I think the PR is ready, I could make a release on Monday.

@patriknw
Owner

great, thanks
then we can use it for akka 2.2-RC1

@havocp havocp closed this issue from a commit
@havocp havocp Try to convert objects with numeric keys to lists
This is mostly intended to provide a way to specify lists
on the command line via Java properties, like -Dfoo.0 -Dfoo.1

Fixes #69
338150f
@havocp havocp closed this in 338150f
@havocp
Owner

1.0.1 should be available/working

@patriknw
Owner

Thanks

@nilsga

Is this somehow possible with environment variables as well?

@havocp
Owner

The lib only uses env variables if they are explicitly pulled in by the .conf file as a ${} reference. The only way I know to do a list as env vars is something like:

 emails += ${?EMAIL_1}
 emails += ${?EMAIL_2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.