lossend opened a new issue, #776:
URL: https://github.com/apache/rocketmq-spring/issues/776

   ## 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()`:
   
   ```java
   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`:
   
   ```java
   return newAttrs;
   ```
   
   A pull request with the fix has been submitted: 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to