This commit is contained in:
Redkale
2020-06-10 20:30:50 +08:00
parent 03de684940
commit 88657fdf63

View File

@@ -80,12 +80,16 @@ public class MessageClient {
} }
} }
if (convertType != null) message.setFormat(convertType); if (convertType != null) message.setFormat(convertType);
if (needresp && message.getResptopic() == null) message.setResptopic(respTopic); if (needresp && (message.getResptopic() == null || message.getResptopic().isEmpty())) {
messageAgent.getProducer().apply(message); message.setResptopic(respTopic);
}
if (counter != null) counter.incrementAndGet(); if (counter != null) counter.incrementAndGet();
messageAgent.getProducer().apply(message);
if (needresp) { if (needresp) {
MessageRespFutureNode node = new MessageRespFutureNode(message.getSeqid(), counter, future); MessageRespFutureNode node = new MessageRespFutureNode(message.getSeqid(), counter, future);
respNodes.put(message.getSeqid(), node); respNodes.put(message.getSeqid(), node);
} else {
future.complete(null);
} }
} catch (Exception ex) { } catch (Exception ex) {
future.completeExceptionally(ex); future.completeExceptionally(ex);