Skip to content

Commit

Permalink
Minor refactor in MessageImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Mar 2, 2019
1 parent 53f7c8d commit f679110
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/main/java/io/vertx/core/eventbus/impl/MessageImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 106,7 @@ public String replyAddress() {

@Override
public void fail(int failureCode, String message) {
if (replyAddress != null) {
sendReply(bus.createMessage(true, replyAddress, null,
new ReplyException(ReplyFailure.RECIPIENT_FAILURE, failureCode, message), null), null, null);
}
reply(new ReplyException(ReplyFailure.RECIPIENT_FAILURE, failureCode, message));
}

@Override
Expand All @@ -130,7 127,8 @@ public void reply(Object message, DeliveryOptions options) {
@Override
public <R> void reply(Object message, DeliveryOptions options, Handler<AsyncResult<Message<R>>> replyHandler) {
if (replyAddress != null) {
sendReply(bus.createMessage(true, replyAddress, options.getHeaders(), message, options.getCodecName()), options, replyHandler);
MessageImpl reply = bus.createMessage(true, replyAddress, options.getHeaders(), message, options.getCodecName());
bus.sendReply(reply, this, options, replyHandler);
}
}

Expand All @@ -147,10 145,6 @@ public MessageCodec<U, V> codec() {
return messageCodec;
}

protected <R> void sendReply(MessageImpl msg, DeliveryOptions options, Handler<AsyncResult<Message<R>>> replyHandler) {
bus.sendReply(msg, this, options, replyHandler);
}

protected boolean isLocal() {
return true;
}
Expand Down

0 comments on commit f679110

Please sign in to comment.