Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void onCheckTimeout(Long event) {
}

public void send(TcpClientConnection tcpClient, AbstractTcpClientPackage tcpClientPackage,
TcpResonseCallback callback) {
TcpResponseCallback callback) {
tcpClient.send(tcpClientPackage, clientConfig.getRequestTimeoutMillis(), callback);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected boolean onLoginResponse(Buffer bodyBuffer) {
}

public void send(AbstractTcpClientPackage tcpClientPackage, long msTimeout,
TcpResonseCallback callback) {
TcpResponseCallback callback) {
requestMap.put(tcpClientPackage.getMsgId(), new TcpRequest(msTimeout, callback));

if (writeToBufferQueue(tcpClientPackage)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public class TcpRequest {

private long threadId;

private TcpResonseCallback responseCallback;
private TcpResponseCallback responseCallback;

public TcpRequest(long msTimeout, TcpResonseCallback responseCallback) {
public TcpRequest(long msTimeout, TcpResponseCallback responseCallback) {
callContext = Vertx.currentContext();
threadId = Thread.currentThread().getId();
this.begin = System.currentTimeMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

import io.servicecomb.foundation.vertx.AsyncResultCallback;

public interface TcpResonseCallback extends AsyncResultCallback<TcpData> {
public interface TcpResponseCallback extends AsyncResultCallback<TcpData> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to still keep the old wrong API with deprecated annotation to warn the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks for pointing out.


}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import io.servicecomb.foundation.vertx.client.tcp.TcpClientVerticle;
import io.servicecomb.foundation.vertx.client.tcp.TcpData;
import io.servicecomb.foundation.vertx.client.tcp.TcpRequest;
import io.servicecomb.foundation.vertx.client.tcp.TcpResonseCallback;
import io.servicecomb.foundation.vertx.client.tcp.TcpResponseCallback;
import io.servicecomb.foundation.vertx.server.TcpParser;
import io.servicecomb.foundation.vertx.server.TcpServer;
import io.servicecomb.foundation.vertx.tcp.TcpOutputStream;
Expand Down Expand Up @@ -76,8 +76,8 @@ public void close() {
new TcpClientConnection(Mockito.mock(Context.class), oNetClient, "highway://127.2.0.1:8080",
new TcpClientConfig());
oTcpClient.checkTimeout();
oTcpClient.send(new TcpClientPackage(null), 123, Mockito.mock(TcpResonseCallback.class));
oTcpClient.send(new TcpClientPackage(null), 123, Mockito.mock(TcpResonseCallback.class));
oTcpClient.send(new TcpClientPackage(null), 123, Mockito.mock(TcpResponseCallback.class));
oTcpClient.send(new TcpClientPackage(null), 123, Mockito.mock(TcpResponseCallback.class));

new MockUp<TcpClientConnectionPool>() {
@Mock
Expand All @@ -88,11 +88,11 @@ protected void startCheckTimeout(TcpClientConfig clientConfig, Context context)
TcpClientConfig config = new TcpClientConfig();
TcpClientConnectionPool oClientPool =
new TcpClientConnectionPool(config, vertx.getOrCreateContext(), oNetClient);
oClientPool.send(oTcpClient, new TcpClientPackage(null), Mockito.mock(TcpResonseCallback.class));
oClientPool.send(oTcpClient, new TcpClientPackage(null), Mockito.mock(TcpResonseCallback.class));
oClientPool.send(oTcpClient, new TcpClientPackage(null), Mockito.mock(TcpResponseCallback.class));
oClientPool.send(oTcpClient, new TcpClientPackage(null), Mockito.mock(TcpResponseCallback.class));
Assert.assertNotNull(oClientPool);

TcpRequest oTcpRequest = new TcpRequest(1234, Mockito.mock(TcpResonseCallback.class));
TcpRequest oTcpRequest = new TcpRequest(1234, Mockito.mock(TcpResponseCallback.class));
oTcpRequest.isTimeout();
oTcpRequest.onReply(Buffer.buffer(), Buffer.buffer(("test").getBytes()));
oTcpRequest.onSendError(new Throwable("test Errorsss"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void tearDown() throws Exception {
@Test
public void testCallBack() {
instance.getClass();
TcpResonseCallback callback = Mockito.mock(TcpResonseCallback.class);
TcpResponseCallback callback = Mockito.mock(TcpResponseCallback.class);
try {
instance.send(new TcpClientPackage(null), 1, callback);
Assert.assertNotNull(callback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ public boolean init(TcpConnection connection, long msgId,
doInit(connection, msgId, header, bodyBuffer);
return true;
} catch (Throwable e) {
String microserviceQualifidName = "unknown";
String microserviceQualifiedName = "unknown";
if (operationMeta != null) {
microserviceQualifidName = operationMeta.getMicroserviceQualifiedName();
microserviceQualifiedName = operationMeta.getMicroserviceQualifiedName();
}
String msg = String.format("decode request error, microserviceQualifidName=%s, msgId=%d",
microserviceQualifidName,
String msg = String.format("decode request error, microserviceQualifiedName=%s, msgId=%d",
microserviceQualifiedName,
msgId);
LOGGER.error(msg, e);

Expand Down