You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "lossend (via GitHub)" <gi...@apache.org> on 2026/06/15 09:42:11 UTC
[PR] fix: AnnotationEnhancer chain silently discards all modifications [rocketmq-spring]
lossend opened a new pull request, #775:
URL: https://github.com/apache/rocketmq-spring/pull/775
## Problem
In `RocketMQMessageListenerBeanPostProcessor.buildEnhancer()`, the lambda accumulates
enhanced annotation attributes into `newAttrs` across all registered `AnnotationEnhancer`
beans, but then returns the original `attrs` instead of `newAttrs`.
This means every `AnnotationEnhancer` bean is silently a no-op — its attribute
modifications are computed but thrown away.
## Fix
Return `newAttrs` instead of `attrs`.
```java
// before
return attrs;
// after
return newAttrs;
```
## Root Cause
`buildEnhancer()` (line 178–184):
```java
this.enhancer = (attrs, element) -> {
Map<String, Object> newAttrs = attrs;
for (AnnotationEnhancer enh : enhancers) {
newAttrs = enh.apply(newAttrs, element);
}
return attrs; // BUG: should be newAttrs
};
```
--
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
Re: [PR] fix: AnnotationEnhancer chain silently discards all modifications [rocketmq-spring]
Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on PR #775:
URL: https://github.com/apache/rocketmq-spring/pull/775#issuecomment-5153390894
## PR Review for #775: fix: AnnotationEnhancer chain silently discards all modifications
### Summary
This PR modifies 1 file(s) with +1/-1 lines changed.
### Changed Files
- rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/annotation/RocketMQMessageListenerBeanPostProcessor.java
### Observations
- PR author: @lossend
- Diff size: 897 characters
- 2 additions, 2 deletions in diff
### Next Steps
A detailed code-level review requires the code engine. This is a structural overview only.
Please verify correctness, thread safety, and backward compatibility manually.
--
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
Re: [PR] fix: AnnotationEnhancer chain silently discards all modifications [rocketmq-spring]
Posted by "lossend (via GitHub)" <gi...@apache.org>.
lossend closed pull request #775: fix: AnnotationEnhancer chain silently discards all modifications
URL: https://github.com/apache/rocketmq-spring/pull/775
--
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