Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [microprofile-dev] 2 ConfigSources same ordinal

I am for a)

On Thu, Jun 4, 2020 at 1:35 AM Andy Guibert <andy.guibert@xxxxxxxxx> wrote:
Even though it is not good practice to have the same ordinal, it would be good if it was at least deterministic. 

Since config sources can be discovered via the service loader it may not be obvious to developers what the ordinals of all of the various config sources are. 

Perhaps we could clear this up in the spec? I could see two possible ways to handle it:
A) Raise an error if two config sources detected with the same ordinal
B) If two config sources detected with the same ordinal, their priority should be deterministic (e.g. sorted by fully-qualifed class name) but does not need to be publicly documented

I could see the non-determinism resulting in some nasty dev/prod parity errors.

On Wed, Jun 3, 2020 at 12:03 PM Emily Jiang <emijiang6@xxxxxxxxxxxxxx> wrote:
>In what order are these ConfigSources set in Config's list?

It is indeterminable. It is very random.

>Is there a rule that provides order consistency?
The sepc does not provide a rule for this. The best practice is not to use the same ordinal for different config sources.

Thanks
Emily

On Wed, Jun 3, 2020 at 4:33 PM Rebecca Searls <rsearls@xxxxxxxxxx> wrote:
When 2 ConfigSources have the same ordinal value,
what is the rule for an implementation's setting order
in the Config's ConfigSource list.

Example:
  BobsIncredibleLibConfigSource ordinal = 110 returns property prodName=BobsIncredibleLib
  User includes BobsIncredibleLibConfigSource in his app but also provides
    UsersCoolAppConfigSource ordinal = 110 and property prodName=UsersCoolApp

In what order are these ConfigSources set in Config's list?
Is there a rule that provides order consistency?
_______________________________________________
microprofile-dev mailing list
microprofile-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/microprofile-dev


--
Thanks
Emily

_______________________________________________
microprofile-dev mailing list
microprofile-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/microprofile-dev
_______________________________________________
microprofile-dev mailing list
microprofile-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/microprofile-dev


--
Reg. Adresse: Red Hat GmbH, Technopark II, Haus C,
Werner-von-Siemens-Ring 14, D-85630 Grasbrunn
Handelsregister: Amtsgericht München HRB 153243
Geschäftsführer: Charles Cachera, Lauie Krebs, Michael O'Neill, Tom Savage

Back to the top