# MicroProfile Config: not using value from higher ordinal source with profile?

**URL:** <https://forum.payara.fish/t/microprofile-config-not-using-value-from-higher-ordinal-source-with-profile/618>\
**Category:** Technical Discussion\
**Created:** [May 15, 2023, 8:24pm UTC](https://forum.payara.fish/t/microprofile-config-not-using-value-from-higher-ordinal-source-with-profile/618 "2023-05-15T20:24:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![poikilotherm](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.payara.fish/poikilotherm/32/206_2.png) [@poikilotherm](https://forum.payara.fish/u/poikilotherm)\
**Post date:** [May 15, 2023, 8:24pm UTC](https://forum.payara.fish/t/microprofile-config-not-using-value-from-higher-ordinal-source-with-profile/618/1 "2023-05-15T20:24:37Z")

</div>

Hi there!

While using Payara Server Full Profile inside a Docker container, I made my application use a MP Config Profile called “ct” by setting the environment variable.

Having a default value in my `microprofile-config .properties` for a certain value `%ct.dataverse.solr.host=solr`, I noticed this was not overwritten when setting an environment variable `DATAVERSE_SOLR_HOST=foobar`.

When setting a variable `_CT_DATAVERSE_SOLR_HOST`, the setting was changed as expected.

My question is now: is this a bug or is this compliant to spec?

Reading MPC 3.0 spec, it says about profiles:

> Conforming implementations are required to search for a configuration source with the highest ordinal (priority) that provides either the property name or the “profile-specific” property name. If the configuration source provides the “profile-specific” name, the value of the “profile-specific” property will be returned. If it doesn’t contain the “profile-specific” name, the value of the plain property will be returned.

[Reading the discussion when the spec for profiles was written](https://github.com/eclipse/microprofile-config/issues/418#issuecomment-618678228), it seems people agreed to make a profiled value provided by a lower ordinal source overrideable by a non-profiled setting in a higher ordinal source.

Looking at [the resolver code](https://github.com/payara/Payara/blob/0704b24df099e928276d34e115b8ab4ae492a60a/nucleus/payara-modules/nucleus-microprofile/config-service/src/main/java/fish/payara/nucleus/microprofile/config/spi/ConfigExpressionResolver.java#L91-L118), it seems the ordinality of a source is not taken into account. (BTW: it seems the core business logoc of resolving order etc hasn’t been touched since Payara 4.1.192 and latest greatest Payara 6.2023.x) But I might be wrong there. Can someone enlighten me here, please?

This is not a bug report (yet?), but if it helps I sure can provide a reproducer. Plz let me know.

Thank you very much!
