You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/11/12 04:53:38 UTC
[GitHub] [rocketmq-spring] Haizi-cp opened a new issue, #501: @AutoConfigureAfter({MessageConverterConfiguration.class}) and @AutoConfigureBefore({RocketMQTransactionConfiguration.class}) not take effect,They are incorrect usage
Haizi-cp opened a new issue, #501:
URL: https://github.com/apache/rocketmq-spring/issues/501
**BUG REPORT**
1. Please
describe the issue you observed:

@AutoConfigureAfter({MessageConverterConfiguration.class})and@AutoConfigureBefore({RocketMQTransactionConfiguration.class})
not take effect , They are incorrect usage.
3. 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.
4.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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] @AutoConfigureAfter({MessageConverterConfiguration.class}) and @AutoConfigureBefore({RocketMQTransactionConfiguration.class}) not take effect,They are incorrect usage [rocketmq-spring]
Posted by "NUAAwqy (via GitHub) via commits" <co...@rocketmq.apache.org>.
NUAAwqy commented on issue #501:
URL: https://github.com/apache/rocketmq-spring/issues/501#issuecomment-6802050557
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:
```
org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration # rocketmq-spring-boot
org.apache.rocketmq.client.autoconfigure.RocketMQAutoConfiguration # rocketmq-v5-client-spring-boot
```
`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:
- `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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-spring] francisoliverlee commented on issue #501: @AutoConfigureAfter({MessageConverterConfiguration.class}) and @AutoConfigureBefore({RocketMQTransactionConfiguration.class}) not take effect,They are incorrect usage
Posted by "francisoliverlee (via GitHub)" <gi...@apache.org>.
francisoliverlee commented on issue #501:
URL: https://github.com/apache/rocketmq-spring/issues/501#issuecomment-1411989443
可以提供下复现问题的代码demo嘛 ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org