Skip to content

The response results of rocketmqtemplate and defaultmqproducer sendstatus are inconsistent #365

Description

@Bin2020

broker 1主1从同步双写,从broker宕机,发送同步消息。RocketMQTemplate应答SEND_OK,DefaultMQProducer应答SLAVE_NOT_AVAILABLE,为什么

SendResult sendResult = rocketMQTemplate.syncSend("testTopic", "test");
System.out.println(sendResult.getSendStatus()); // SEND_OK
DefaultMQProducer producer = new TransactionMQProducer("my-group2");
producer.setNamesrvAddr("127.0.0.1:9876");
producer.start();

org.apache.rocketmq.common.message.Message msg = new org.apache.rocketmq.common.message.Message("testTopic", "test".getBytes(StandardCharsets.UTF_8));
SendResult sendResult2 = producer.send(msg);
System.out.println(sendResult2.getSendStatus()); // SLAVE_NOT_AVAILABLE

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions