RockteMQ-AI commented on issue #695: URL: https://github.com/apache/rocketmq-spring/issues/695#issuecomment-5208090336
**Issue Evaluation** Category: `type/bug` | Status: **Confirmed** Excellent analysis. The root cause is clearly identified in `DefaultRocketMQListenerContainer.java` L543-551. **Root Cause:** When the listener message type is `byte[]`, the `ByteArrayMessageConverter.convertFromInternal()` returns the payload as-is. However, L551 sets the payload to `str` (a `String`), causing a `ClassCastException` when the framework later tries to cast it to `byte[]`. **Impact:** Any `RocketMQListener<byte[]>` implementation will fail with `ClassCastException: java.lang.String cannot be cast to [B`. **Severity:** high — breaks a common use case (binary message consumption). **Proposed Fix Direction:** At L551, when the target type is `byte[]`, the payload should remain as the raw byte array from the message body rather than being converted to a String. The conversion logic should check the target type before deciding whether to stringify the payload. An automated fix proposal can be generated. Reply `/approve` to proceed with PR generation. --- *Automated evaluation by github-manager* -- 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]
