MP Config 2.0 sort order

4 views
Skip to first unread message

Kabir Khan

unread,
Dec 15, 2020, 9:34:20 AM12/15/20
to SmallRye
Hi,

I am upgrading SmallRye Config to 2.0.0-RC3 in WildFly and am down to one failing test.

This test seems to have been added to deal with the case where more than one ConfigSource has the same priority (some discussion in https://issues.redhat.com/browse/WFLY-10852).

In SmallRye Config 1.x, https://github.com/smallrye/smallrye-config/pull/12 seems to have added this but I believe this is not in SmallRye Config 2.0.

I'm still getting familiar with SmallRye Config, so in case someone has some ideas where to add this that would be appreciated. My naive attempts have failed so far.

Or if this is something we should not be doing, let me know and I will see if we can adjust the test our end.

Thanks,

Kabir

Roberto Cortez

unread,
Dec 15, 2020, 11:04:29 AM12/15/20
to smal...@googlegroups.com
Hi Kabir,

We changed the sort to use the loading order instead of the name:

Can you update the test on your side? Do you think it will be an issue to change that behaviour in WF?

Cheers,
Roberto

--
You received this message because you are subscribed to the Google Groups "SmallRye" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smallrye+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smallrye/CAJfxLg7AsmWSM9j1zqYPRfdELZTzbK2q1rstrt-GJ6i-QxFExA%40mail.gmail.com.

Kabir Khan

unread,
Dec 15, 2020, 12:34:52 PM12/15/20
to SmallRye
On Tue, 15 Dec 2020 at 16:04, 'Roberto Cortez' via SmallRye <smal...@googlegroups.com> wrote:
Hi Kabir,

We changed the sort to use the loading order instead of the name:

Can you update the test on your side? Do you think it will be an issue to change that behaviour in WF?
I think it can be updated, but need to discuss a bit with the others first once I've understood better.
I see a loadPriority which seems to be used as the 'second' criteria for sorting (with ordinal/priority being the first). 
I'm still getting my head around it but it looks like loadPriority is influenced by the order ConfigSources are added to the builder. 
If that is the case, I need to check whether WildFly adds these in a reliable order.

Cheers,
Roberto

On 15 Dec 2020, at 14:34, Kabir Khan <kk...@redhat.com> wrote:

Hi,

I am upgrading SmallRye Config to 2.0.0-RC3 in WildFly and am down to one failing test.

This test seems to have been added to deal with the case where more than one ConfigSource has the same priority (some discussion in https://issues.redhat.com/browse/WFLY-10852).

In SmallRye Config 1.x, https://github.com/smallrye/smallrye-config/pull/12 seems to have added this but I believe this is not in SmallRye Config 2.0.

I'm still getting familiar with SmallRye Config, so in case someone has some ideas where to add this that would be appreciated. My naive attempts have failed so far.

Or if this is something we should not be doing, let me know and I will see if we can adjust the test our end.

Thanks,

Kabir

--
You received this message because you are subscribed to the Google Groups "SmallRye" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smallrye+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smallrye/CAJfxLg7AsmWSM9j1zqYPRfdELZTzbK2q1rstrt-GJ6i-QxFExA%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "SmallRye" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smallrye+u...@googlegroups.com.

Roberto Cortez

unread,
Dec 15, 2020, 12:46:13 PM12/15/20
to smal...@googlegroups.com

On 15 Dec 2020, at 17:34, Kabir Khan <kk...@redhat.com> wrote:



On Tue, 15 Dec 2020 at 16:04, 'Roberto Cortez' via SmallRye <smal...@googlegroups.com> wrote:
Hi Kabir,

We changed the sort to use the loading order instead of the name:

Can you update the test on your side? Do you think it will be an issue to change that behaviour in WF?
I think it can be updated, but need to discuss a bit with the others first once I've understood better.
I see a loadPriority which seems to be used as the 'second' criteria for sorting (with ordinal/priority being the first). 
I'm still getting my head around it but it looks like loadPriority is influenced by the order ConfigSources are added to the builder. 
If that is the case, I need to check whether WildFly adds these in a reliable order.


Yes, the ordinal will still be the primary way to sort, and then in case of a tie the loading order kicks in. Yes, the loading order is influenced by the order in which the sources are added into the builder. Usually, since most sources are auto discovered by the ServiceLoader or the Classloader, it will follow the order used there.



Cheers,
Roberto

On 15 Dec 2020, at 14:34, Kabir Khan <kk...@redhat.com> wrote:

Hi,

I am upgrading SmallRye Config to 2.0.0-RC3 in WildFly and am down to one failing test.

This test seems to have been added to deal with the case where more than one ConfigSource has the same priority (some discussion in https://issues.redhat.com/browse/WFLY-10852).

In SmallRye Config 1.x, https://github.com/smallrye/smallrye-config/pull/12 seems to have added this but I believe this is not in SmallRye Config 2.0.

I'm still getting familiar with SmallRye Config, so in case someone has some ideas where to add this that would be appreciated. My naive attempts have failed so far.

Or if this is something we should not be doing, let me know and I will see if we can adjust the test our end.

Thanks,

Kabir

--
You received this message because you are subscribed to the Google Groups "SmallRye" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smallrye+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smallrye/CAJfxLg7AsmWSM9j1zqYPRfdELZTzbK2q1rstrt-GJ6i-QxFExA%40mail.gmail.com.


--
You received this message because you are subscribed to the Google Groups "SmallRye" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smallrye+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smallrye/EFF0884E-9EAD-4692-80D8-E36CD3D8037B%40yahoo.com.

--
You received this message because you are subscribed to the Google Groups "SmallRye" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smallrye+u...@googlegroups.com.

Kabir Khan

unread,
Dec 15, 2020, 12:52:19 PM12/15/20
to SmallRye
On Tue, 15 Dec 2020 at 17:46, 'Roberto Cortez' via SmallRye <smal...@googlegroups.com> wrote:


On 15 Dec 2020, at 17:34, Kabir Khan <kk...@redhat.com> wrote:



On Tue, 15 Dec 2020 at 16:04, 'Roberto Cortez' via SmallRye <smal...@googlegroups.com> wrote:
Hi Kabir,

We changed the sort to use the loading order instead of the name:

Can you update the test on your side? Do you think it will be an issue to change that behaviour in WF?
I think it can be updated, but need to discuss a bit with the others first once I've understood better.
I see a loadPriority which seems to be used as the 'second' criteria for sorting (with ordinal/priority being the first). 
I'm still getting my head around it but it looks like loadPriority is influenced by the order ConfigSources are added to the builder. 
If that is the case, I need to check whether WildFly adds these in a reliable order.


Yes, the ordinal will still be the primary way to sort, and then in case of a tie the loading order kicks in. Yes, the loading order is influenced by the order in which the sources are added into the builder. Usually, since most sources are auto discovered by the ServiceLoader or the Classloader, it will follow the order used there.
Thanks, that saved me some digging :)

In WildFly these may also come from entries in the subsystem, but reworking that to impose an order there should be simple.

Roberto Cortez

unread,
Dec 15, 2020, 7:13:31 PM12/15/20
to smal...@googlegroups.com

On 15 Dec 2020, at 17:51, Kabir Khan <kk...@redhat.com> wrote:



On Tue, 15 Dec 2020 at 17:46, 'Roberto Cortez' via SmallRye <smal...@googlegroups.com> wrote:


On 15 Dec 2020, at 17:34, Kabir Khan <kk...@redhat.com> wrote:



On Tue, 15 Dec 2020 at 16:04, 'Roberto Cortez' via SmallRye <smal...@googlegroups.com> wrote:
Hi Kabir,

We changed the sort to use the loading order instead of the name:

Can you update the test on your side? Do you think it will be an issue to change that behaviour in WF?
I think it can be updated, but need to discuss a bit with the others first once I've understood better.
I see a loadPriority which seems to be used as the 'second' criteria for sorting (with ordinal/priority being the first). 
I'm still getting my head around it but it looks like loadPriority is influenced by the order ConfigSources are added to the builder. 
If that is the case, I need to check whether WildFly adds these in a reliable order.


Yes, the ordinal will still be the primary way to sort, and then in case of a tie the loading order kicks in. Yes, the loading order is influenced by the order in which the sources are added into the builder. Usually, since most sources are auto discovered by the ServiceLoader or the Classloader, it will follow the order used there.
Thanks, that saved me some digging :)

In WildFly these may also come from entries in the subsystem, but reworking that to impose an order there should be simple.

Great! If there is something that we need to adjust from this side, let me know :)

Reply all
Reply to author
Forward
0 new messages