From b2717f32c63a396ca00eb8899e7402bccb4039df Mon Sep 17 00:00:00 2001 From: fizz <54924160+WhyStart@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:28:14 +0800 Subject: [PATCH] feat:Modify the inner class call to use the bean instance invocation method (#687) --- .../spring/support/DefaultRocketMQListenerContainer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java b/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java index e632fbc2..c3bf81b2 100644 --- a/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java +++ b/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java @@ -429,7 +429,8 @@ public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeCo log.debug("received msg: {}", messageExt); try { long now = System.currentTimeMillis(); - handleMessage(messageExt); + DefaultRocketMQListenerContainer container = applicationContext.getBean(name, DefaultRocketMQListenerContainer.class); + container.handleMessage(messageExt); long costTime = System.currentTimeMillis() - now; log.debug("consume {} cost: {} ms", messageExt.getMsgId(), costTime); } catch (Exception e) { @@ -452,7 +453,8 @@ public ConsumeOrderlyStatus consumeMessage(List msgs, ConsumeOrderly log.debug("received msg: {}", messageExt); try { long now = System.currentTimeMillis(); - handleMessage(messageExt); + DefaultRocketMQListenerContainer container = applicationContext.getBean(name, DefaultRocketMQListenerContainer.class); + container.handleMessage(messageExt); long costTime = System.currentTimeMillis() - now; log.debug("consume {} cost: {} ms", messageExt.getMsgId(), costTime); } catch (Exception e) {