Skip to content

Commit

Permalink
[ISSUE apache#8584] fix missing brokerName in sendMessageBack request (
Browse files Browse the repository at this point in the history
…apache#8585)

* fix missing brokerName in sendMessageBack request

* fix
  • Loading branch information
yuz10 authored Aug 30, 2024
1 parent 71ec1ed commit 720c87e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public void setRegisterTopics(Set<String> registerTopics) {
public void sendMessageBack(MessageExt msg, int delayLevel)
throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
msg.setTopic(withNamespace(msg.getTopic()));
this.defaultMQPullConsumerImpl.sendMessageBack(msg, delayLevel, null);
this.defaultMQPullConsumerImpl.sendMessageBack(msg, delayLevel, msg.getBrokerName());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ public void setSubscription(Map<String, String> subscription) {
public void sendMessageBack(MessageExt msg, int delayLevel)
throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
msg.setTopic(withNamespace(msg.getTopic()));
this.defaultMQPushConsumerImpl.sendMessageBack(msg, delayLevel, (String) null);
this.defaultMQPushConsumerImpl.sendMessageBack(msg, delayLevel, msg.getBrokerName());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ public void sendMessageBack(MessageExt msg, int delayLevel, final String brokerN

public void sendMessageBack(MessageExt msg, int delayLevel, final MessageQueue mq)
throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
sendMessageBack(msg, delayLevel, null, mq);
sendMessageBack(msg, delayLevel, msg.getBrokerName(), mq);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,11 @@ public void testQueryMessageByUniqKey() throws InterruptedException, MQClientExc

@Test
public void testSendMessageBack() throws InterruptedException, MQClientException, MQBrokerException, RemotingException {
when(mQClientFactory.findBrokerAddressInPublish(anyString())).thenReturn(defaultBrokerAddr);
defaultMQPushConsumerImpl.sendMessageBack(createMessageExt(), 1, createMessageQueue());
verify(mqClientAPIImpl).consumerSendMessageBack(
eq(defaultBrokerAddr),
any(),
eq(defaultBroker),
any(MessageExt.class),
any(),
eq(1),
Expand Down

0 comments on commit 720c87e

Please sign in to comment.