From f525a34f6151b8ea9a91db49d3f55db636e070f8 Mon Sep 17 00:00:00 2001 From: Lei Zhiyuan Date: Wed, 7 Feb 2024 10:52:32 +0800 Subject: [PATCH] [ISSUE #7813] setStartDetectorEnable Not effective --- .../client/impl/producer/DefaultMQProducerImpl.java | 4 ++++ .../apache/rocketmq/client/producer/DefaultMQProducer.java | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java index daab475fc1b..26e6297a8c7 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java @@ -1810,4 +1810,8 @@ public void setSendLatencyFaultEnable(final boolean sendLatencyFaultEnable) { public DefaultMQProducer getDefaultMQProducer() { return defaultMQProducer; } + + public MQFaultStrategy getMqFaultStrategy() { + return mqFaultStrategy; + } } diff --git a/client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java b/client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java index 5d785a063c2..13be47c79da 100644 --- a/client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java +++ b/client/src/main/java/org/apache/rocketmq/client/producer/DefaultMQProducer.java @@ -1366,4 +1366,10 @@ public List getTopics() { public void setTopics(List topics) { this.topics = topics; } + + @Override + public void setStartDetectorEnable(boolean startDetectorEnable) { + super.setStartDetectorEnable(startDetectorEnable); + this.defaultMQProducerImpl.getMqFaultStrategy().setStartDetectorEnable(startDetectorEnable); + } }