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

Configure sensible order for metrics aspects #42450

Closed
wants to merge 1 commit into from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Sep 26, 2024

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 26, 2024
@quaff quaff marked this pull request as draft September 26, 2024 01:56
@quaff
Copy link
Contributor Author

quaff commented Sep 26, 2024

Not sure tests should be added and how, I see other configuration doesn't test @Order on @Bean method.

@wilkinsona
Copy link
Member

Thanks for the proposal. I'm not too keen on adding magic numbers for the aspects' ordering, particularly as it working correctly relies upon Framework using a particular ordering. Let's see how spring-projects/spring-framework#33595 plays out before doing anything in Boot.

@wilkinsona wilkinsona added the status: on-hold We can't start working on this issue yet label Sep 26, 2024
@wilkinsona
Copy link
Member

On second reading of the Framework issue, I think this is really subjective: some will argue that the current ordering is sensible will others will want the opposite. I can see both sides as it depends on whether or not you see the transaction processing as part of the method invocation. Given this, I'm going to close this one as I don't think hard-coding a different order is the right answer. Depending on what happens on the Framework side, we may want to make a different change, for example one that allows the ordering to be configurable.

@wilkinsona wilkinsona closed this Sep 26, 2024
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: on-hold We can't start working on this issue yet status: waiting-for-triage An issue we've not yet triaged labels Sep 26, 2024
@quaff
Copy link
Contributor Author

quaff commented Sep 26, 2024

On second reading of the Framework issue, I think this is really subjective: some will argue that the current ordering is sensible will others will want the opposite. I can see both sides as it depends on whether or not you see the transaction processing as part of the method invocation. Given this, I'm going to close this one as I don't think hard-coding a different order is the right answer. Depending on what happens on the Framework side, we may want to make a different change, for example one that allows the ordering to be configurable.

It's hard-coding the default order, application always can register their own Bean to override it.
Allowing configure the order is great, and please reconsider #27897

@wilkinsona
Copy link
Member

It's hard-coding the default order, application always can register their own Bean to override it.

As I said, the best ordering is subjective. Changing it may break some users so I think it's better to leave it as it is until we have a better way of users configuring their preferred order.

Allowing configure the order is great, and please reconsider #27897

We can't reconsider #27897 as the order attribute on @EnableTransactionManagement is still an int.

There's no point doing anything more here until we know what direction to head in. Let's slow down a bit and see what comes of spring-projects/spring-framework#33595.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants