private void endTransaction(//
final SendResult sendResult, //
final LocalTransactionState localTransactionState, //
final Throwable localException) throws RemotingException, MQBrokerException,
InterruptedException, UnknownHostException {
final MessageId id = MessageDecoder.decodeMessageId(sendResult.getMsgId());
final String addr = RemotingUtil.socketAddress2String(id.getAddress());
EndTransactionRequestHeader requestHeader = new EndTransactionRequestHeader();
requestHeader.setCommitLogOffset(id.getOffset());
switch (localTransactionState) {
case COMMIT_MESSAGE:
requestHeader.setCommitOrRollback(MessageSysFlag.TransactionCommitType);
break;
case ROLLBACK_MESSAGE: