Bug Description
In RocketMQMessageListenerBeanPostProcessor.buildEnhancer(), the composed AnnotationEnhancer lambda correctly accumulates modified attributes through all registered enhancer beans into newAttrs, but then returns the original attrs instead of newAttrs.
This makes every registered AnnotationEnhancer bean a silent no-op — attribute modifications are computed but immediately discarded.
Affected Version
2.3.6 (rocketmq-v5-client-spring-boot)
Root Cause
RocketMQMessageListenerBeanPostProcessor.buildEnhancer():
this.enhancer = (attrs, element) -> {
Map<String, Object> newAttrs = attrs;
for (AnnotationEnhancer enh : enhancers) {
newAttrs = enh.apply(newAttrs, element); // accumulates correctly
}
return attrs; // BUG: discards all changes, should be newAttrs
};
Expected Behavior
AnnotationEnhancer beans registered in the Spring context should be able to override @RocketMQMessageListener annotation attributes (e.g. topic, consumerGroup) at runtime.
Actual Behavior
All AnnotationEnhancer customizations are silently ignored. The original annotation attributes are always used.
Impact
Any application that relies on AnnotationEnhancer to dynamically override @RocketMQMessageListener attributes — for example, injecting topic or consumerGroup from environment properties — will find their customizations have no effect.
Fix
Return newAttrs instead of attrs:
A pull request with the fix has been submitted: #775
Bug Description
In
RocketMQMessageListenerBeanPostProcessor.buildEnhancer(), the composedAnnotationEnhancerlambda correctly accumulates modified attributes through all registered enhancer beans intonewAttrs, but then returns the originalattrsinstead ofnewAttrs.This makes every registered
AnnotationEnhancerbean a silent no-op — attribute modifications are computed but immediately discarded.Affected Version
2.3.6(rocketmq-v5-client-spring-boot)Root Cause
RocketMQMessageListenerBeanPostProcessor.buildEnhancer():Expected Behavior
AnnotationEnhancerbeans registered in the Spring context should be able to override@RocketMQMessageListenerannotation attributes (e.g. topic, consumerGroup) at runtime.Actual Behavior
All
AnnotationEnhancercustomizations are silently ignored. The original annotation attributes are always used.Impact
Any application that relies on
AnnotationEnhancerto dynamically override@RocketMQMessageListenerattributes — for example, injecting topic or consumerGroup from environment properties — will find their customizations have no effect.Fix
Return
newAttrsinstead ofattrs:A pull request with the fix has been submitted: #775