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

Beta blog post for mpConfig-1.3 #3993

Closed
tevans78 opened this issue Jun 18, 2018 · 3 comments

Comments

@tevans78
Copy link
Member

commented Jun 18, 2018

Blog Questions

Have you provided @lauracowen the necessary Blog text and "what's new"? If not, do so here.

If your feature was described in a previous blog post and nothing has changed, provide a link to the most recent blog post that contains the relevant text.

If no, answer the following questions with as much detail as you can:

a. Which Liberty feature does it relate to?

i. Human-readable name (eg WebSockets feature)
MicroProfile Config 1.3

ii. Feature name (eg websockets-1.0)
mpConfig-1.3

iii. Is this a new Feature or is it an update to an existing feature?
New

iv. Provide the qualified name of all changed feature deliveries?
(eg: com.ibm.websphere.appserver.transportSecurity-1.0.esa)
com.ibm.websphere.appserver.mpConfig-1.3.esa
com.ibm.websphere.appserver.org.eclipse.microprofile.mpConfig-1.3.esa

b. Who is the target audience? eg application developers, devops pipeline devs, appserver administrators, etc
Microservice developers

c. Why should they get excited about it (2-3 sentences)?
The OpenLiberty implementation of the MicroProfile Config 1.3 specification, https://github.com/eclipse/microprofile-config/tree/1.3 introduces the ability to easily and dynamically change your application's configuration by adding or modifying variables in the OpenLiberty server.xml file.

    In addition, it builds on previous versions of MicroProfile Config with enhancements in the areas of implicit converters and the mapping of Config properties to environment variables. You can use this feature with either the cdi-1.2 feature or the cdi-2.0 feature.

You can find a full list of changes since version 1.2 here: https://github.com/eclipse/microprofile-config/milestone/3?closed=1

i. Explain how this new feature literally makes their life easier? Why should they care? What was the problem before and how does this solve it for them?

ii. Explain how to make it work. (If it’s brief, just give instructions, otherwise give a brief overview and then link to the externally available docs.) Include screenshots and/or code snippets to illustrate how to use it, if relevant.

iii. Provide links to any docs in the externally available Knowledge Center.

iv. If relevant, provide links to external websites about this technology.

API/SPI changes

No API/SPI changes.

Functional changes

The OpenLiberty implementation of MicroProfile Config 1.3 introduces the ability to define a MicroProfile application's configuration through the OpenLiberty server.xml file.

A variable element such as,

<variable name="varServerXMLKey1" value="valueinVarServerXMLVariable1" />

assigns a value to a configuration entity that may be accessed by any application running on the Server. An appProperties property element such as,

<application location="variableServerXMLApp.war">
    <appProperties>
         <property name="appServerXMLKey1" value="valueinAppProperties1"/>
    </appProperties>
</application>

assigns a value to a configuration entity that may be accessed by a specific application.

The implicit (common sense) converters have been improved and some of the built-in converters are removed from the spec as they are covered by implicit converters. The method invocation sequence on implicit converters are further improved (#325 - eclipse/microprofile-config#325).

Implementations must also support the mapping of a config property to the corresponding environment variable (#264 - eclipse/microprofile-config#264)

Specification Changes

Specification changes: (#348 - eclipse/microprofile-config#348), (#325 - eclipse/microprofile-config#325) and (#264 - eclipse/microprofile-config#264).

Other changes

The API bundle can work with either CDI 1.2 or CDI 2.0 in an OSGi environment.

To enable the MicroProfile Config 1.3 feature just add the following feature definition to your server.xml:

mpConfig-1.3

For more information about MicroProfile Config 1.3, see the MicroProfile.io website http://microprofile.io/project/eclipse/microprofile-config

MicroProfile Config guides:
https://openliberty.io/guides/microprofile-config.html
https://openliberty.io/guides/microprofile-config-intro.html

MicroProfile Config v1.3 spec:
https://github.com/eclipse/microprofile-config/releases/tag/1.3

d. Is this feature part of Open Liberty or is it WebSphere Liberty-only?
Open Liberty

e. Attach any images to this work item as .png files.

@neilgsyoung

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2018

I've opened RTC 256716, inserted text for Laura and made the WI a child of RTC 250909 (the mp config 1.3 Feature)

@tevans78

This comment has been minimized.

Copy link
Member Author

commented Jul 25, 2018

@lauracowen The sections on Implicit converter improvements and Mapping a config property to environment variable need a bit more text...

Implicit converter improvements (#325)

The implicit converters have been improved such that if no built-in nor custom Converter is available for a requested Type T, an implicit Converter is automatically provided if:

  • The target type {@code T} has a {@code public static T of(String)} method, or
  • The target type {@code T} has a {@code public static T valueOf(String)} method, or
  • The target type {@code T} has a public Constructor with a String parameter, or
  • The target type {@code T} has a {@code public static T parse(CharSequence)} method
    This change means that some built-in converters were no longer required and have been removed.

Mapping a config property to environment variable (#264).

Some operating systems allow only alphabetic characters or an underscore, _, in environment variables. Other characters such as ., /, etc may be disallowed. In order to set a value for a config property that has a name containing such disallowed characters from an environment variable, the following rules are used.

This ConfigSource searches 3 environment variables for a given property name (e.g. com.ACME.size):

  1. Exact match (i.e. com.ACME.size)
  2. Replace the character that is neither alphanumeric nor \_ with _ (i.e. com_ACME_size)
  3. Replace the character that is neither alphanumeric nor \_ with _ and convert to upper case (i.e. COM_ACME_SIZE)
    The first environment variable that is found is returned by this ConfigSource.
@tevans78

This comment has been minimized.

Copy link
Member Author

commented Aug 29, 2018

MP Config 1.3 is complete. Closing.

@tevans78 tevans78 closed this Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.