Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IClientConfig should provide APIs to support arbitrary typed values #81

Closed
allenxwang opened this issue Apr 3, 2014 · 1 comment
Closed
Milestone

Comments

@allenxwang
Copy link

Currently IClientConfig only supports storing and retrieving configuration values as String, and a few convenience APIs to convert them to limited types like Integer and Boolean. It requires user to know the actual data type associated with each config key, and pays a conversion cost when the value is retrieved.

It would be nice for IClientConfig and DefaultClientConfigImpl to support arbitrary configuration values in an intuitive way.

Here is the proposal:

  • Associate a generic type for each common configuration key.
  • Add new APIs in IClientConfig to support retrieving values with the generically typed configuration key.
  • Reserve the behavior to read configuration values as string from Archaius and convert them to desired type on demand.

Here is the code example to show desired behavior:

    public static final IClientConfigKey<Integer> ReadTimeout = ...

    int readTimeout = clientConfig.getPropertyWithType(IClientConfigKey.CommonKeys.ReadTimeout);
@allenxwang allenxwang added this to the 2.0 milestone Jul 24, 2014
@allenxwang
Copy link
Author

Added in Ribbon 2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant