Reply address is never set in MessageImpl constructor

This commit is contained in:
Julien Viet
2019-10-18 13:16:20 +02:00
parent 05067ca881
commit a06aa2a296
5 changed files with 6 additions and 10 deletions

View File

@@ -235,7 +235,7 @@ public class EventBusImpl implements EventBus, MetricsProvider {
Objects.requireNonNull(address, "no null address accepted");
MessageCodec codec = codecManager.lookupCodec(body, codecName);
@SuppressWarnings("unchecked")
MessageImpl msg = new MessageImpl(address, null, headers, body, codec, send, src, this);
MessageImpl msg = new MessageImpl(address, headers, body, codec, send, src, this);
return msg;
}

View File

@@ -43,12 +43,11 @@ public class MessageImpl<U, V> implements Message<V> {
this.src = src;
}
public MessageImpl(String address, String replyAddress, MultiMap headers, U sentBody,
public MessageImpl(String address, MultiMap headers, U sentBody,
MessageCodec<U, V> messageCodec,
boolean send, boolean src, EventBusImpl bus) {
this.messageCodec = messageCodec;
this.address = address;
this.replyAddress = replyAddress;
this.headers = headers;
this.sentBody = sentBody;
this.send = send;

View File

@@ -178,7 +178,7 @@ public class ClusteredEventBus extends EventBusImpl {
Objects.requireNonNull(address, "no null address accepted");
MessageCodec codec = codecManager.lookupCodec(body, codecName);
@SuppressWarnings("unchecked")
ClusteredMessage msg = new ClusteredMessage(serverID, address, null, headers, body, codec, send, src, this);
ClusteredMessage msg = new ClusteredMessage(serverID, address, headers, body, codec, send, src, this);
return msg;
}

View File

@@ -46,9 +46,9 @@ public class ClusteredMessage<U, V> extends MessageImpl<U, V> {
super(src, bus);
}
public ClusteredMessage(ServerID sender, String address, String replyAddress, MultiMap headers, U sentBody,
public ClusteredMessage(ServerID sender, String address, MultiMap headers, U sentBody,
MessageCodec<U, V> messageCodec, boolean send, boolean src, EventBusImpl bus) {
super(address, replyAddress, headers, sentBody, messageCodec, send, src, bus);
super(address, headers, sentBody, messageCodec, send, src, bus);
this.sender = sender;
}

View File

@@ -11,9 +11,6 @@
package io.vertx.core.eventbus.impl.clustered;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.eventbus.EventBusOptions;
@@ -139,7 +136,7 @@ class ConnectionHolder {
close();
});
ClusteredMessage pingMessage =
new ClusteredMessage<>(serverID, PING_ADDRESS, null, null, null, new PingMessageCodec(), true, true, eventBus);
new ClusteredMessage<>(serverID, PING_ADDRESS, null, null, new PingMessageCodec(), true, true, eventBus);
Buffer data = pingMessage.encodeToWire();
socket.write(data);
});