You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@AutoConfigureAfter({MessageConverterConfiguration.class}) and @AutoConfigureBefore({RocketMQTransactionConfiguration.class}) not take effect,They are incorrect usage #501
Please describe the issue you observed:
@AutoConfigureAfter({MessageConverterConfiguration.class})and@AutoConfigureBefore({RocketMQTransactionConfiguration.class})
not take effect , They are incorrect usage.
Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
@AutoConfigureAfter and @AutoConfigureBefore, only the autoConfiguration classes under spring.factories will be sorted.
MessageConverterConfiguration.class and RocketMQTransactionConfiguration.class not under spring.factories , so, They are incorrect usage.
i want to delete it to fix this problem.
Influence
now , It will not affect the function as a whole. but when someone read it or learn it and they think it's right.They will also write this in their own projects , this is not a good behavior.
The ordering annotations are still present on master today and remain ineffective - here is the demonstration that was requested earlier in this issue.
@AutoConfigureAfter / @AutoConfigureBefore are evaluated by Spring Boot's auto-configuration sorter, which only orders the classes listed in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. In both modules that file contains exactly one entry:
MessageConverterConfiguration, RocketMQTransactionConfiguration and RocketMQListenerConfiguration are not registered there - they are all pulled in through @Import on RocketMQAutoConfiguration - so the sorter never sees them and the annotations never take effect:
Verified by removing them: both module test suites pass unchanged on JDK 17 (43 tests in rocketmq-spring-boot, including the existing auto-configuration wiring tests), confirming the annotations were dead code.
Fix proposed in #784 - it removes the four dead annotations and adds a small regression test per module that fails if an ordering annotation ever references a non-registered auto-configuration again.
Activity
francisoliverlee commentedon Feb 1, 2023
可以提供下复现问题的代码demo嘛 ?
NUAAwqy commentedon Nov 11, 2026
The ordering annotations are still present on
mastertoday and remain ineffective - here is the demonstration that was requested earlier in this issue.@AutoConfigureAfter/@AutoConfigureBeforeare evaluated by Spring Boot's auto-configuration sorter, which only orders the classes listed inMETA-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. In both modules that file contains exactly one entry:MessageConverterConfiguration,RocketMQTransactionConfigurationandRocketMQListenerConfigurationare not registered there - they are all pulled in through@ImportonRocketMQAutoConfiguration- so the sorter never sees them and the annotations never take effect:RocketMQAutoConfiguration:@AutoConfigureAfter({MessageConverterConfiguration.class}),@AutoConfigureBefore({RocketMQTransactionConfiguration.class})RocketMQListenerConfiguration(both modules):@AutoConfigureAfter(RocketMQAutoConfiguration.class)Verified by removing them: both module test suites pass unchanged on JDK 17 (43 tests in
rocketmq-spring-boot, including the existing auto-configuration wiring tests), confirming the annotations were dead code.Fix proposed in #784 - it removes the four dead annotations and adds a small regression test per module that fails if an ordering annotation ever references a non-registered auto-configuration again.