The code below is unable to register the listener
@RocketMQMessageListener(consumerGroup = "", topic = "test")
static class Receiver implements RocketMQListener {
@Override
public void onMessage(Object message) {
}
}
@Bean
public Receiver customEnhancer() {
Enhancer enhancer = new Enhancer();
enhancer.setSuperclass(Receiver.class);
enhancer.setCallback((MethodInterceptor) (o, method, objects, methodProxy) -> null);
return (Receiver) enhancer.create();
}
version: 2.2.3
I reviewed the logic of RocketMQMessageListenerBeanPostProcessor and found several issues.
AopUtils.getTargetClass does not traverse nested proxies, whereas in version 4.x, AopProxyUtils.ultimateTargetClass is used instead.
- if a custom CGLIB listener does not implement the SpringProxy interface, the correct target class cannot be obtained.


The code below is unable to register the listener
version: 2.2.3
I reviewed the logic of
RocketMQMessageListenerBeanPostProcessorand found several issues.AopUtils.getTargetClassdoes not traverse nested proxies, whereas in version 4.x,AopProxyUtils.ultimateTargetClassis used instead.