未验证 提交 e1e2333c 编写于 作者: R rongtong 提交者: GitHub

Merge pull request #2024 from rushsky518/mqclient

[ISSUE #2025] Refactor  MQClientAPIImpl#processSendResponse
......@@ -643,29 +643,27 @@ public class MQClientAPIImpl {
final Message msg,
final RemotingCommand response
) throws MQBrokerException, RemotingCommandException {
SendStatus sendStatus;
switch (response.getCode()) {
case ResponseCode.FLUSH_DISK_TIMEOUT:
case ResponseCode.FLUSH_SLAVE_TIMEOUT:
case ResponseCode.SLAVE_NOT_AVAILABLE: {
}
case ResponseCode.SUCCESS: {
SendStatus sendStatus = SendStatus.SEND_OK;
switch (response.getCode()) {
case ResponseCode.FLUSH_DISK_TIMEOUT:
case ResponseCode.FLUSH_DISK_TIMEOUT: {
sendStatus = SendStatus.FLUSH_DISK_TIMEOUT;
break;
case ResponseCode.FLUSH_SLAVE_TIMEOUT:
}
case ResponseCode.FLUSH_SLAVE_TIMEOUT: {
sendStatus = SendStatus.FLUSH_SLAVE_TIMEOUT;
break;
case ResponseCode.SLAVE_NOT_AVAILABLE:
}
case ResponseCode.SLAVE_NOT_AVAILABLE: {
sendStatus = SendStatus.SLAVE_NOT_AVAILABLE;
break;
case ResponseCode.SUCCESS:
}
case ResponseCode.SUCCESS: {
sendStatus = SendStatus.SEND_OK;
break;
default:
assert false;
break;
}
default: {
throw new MQBrokerException(response.getCode(), response.getRemark());
}
}
SendMessageResponseHeader responseHeader =
......@@ -704,12 +702,6 @@ public class MQClientAPIImpl {
sendResult.setRegionId(regionId);
return sendResult;
}
default:
break;
}
throw new MQBrokerException(response.getCode(), response.getRemark());
}
public PullResult pullMessage(
final String addr,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册