From 633ac28b8abc63e388d6ebe6081c41371b69ed29 Mon Sep 17 00:00:00 2001 From: Jaskey Date: Tue, 11 Apr 2017 19:54:26 +0800 Subject: [PATCH 1/5] improve error message when pull exception --- .../org/apache/rocketmq/client/impl/MQClientAPIImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java index 12580c14977..3c3884d1f22 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java @@ -577,12 +577,12 @@ public void operationComplete(ResponseFuture responseFuture) { } } else { if (!responseFuture.isSendRequestOK()) { - pullCallback.onException(new MQClientException("send request failed", responseFuture.getCause())); + pullCallback.onException(new MQClientException("send request failed to " + addr + ".request: " + request, responseFuture.getCause())); } else if (responseFuture.isTimeout()) { - pullCallback.onException(new MQClientException("wait response timeout " + responseFuture.getTimeoutMillis() + "ms", + pullCallback.onException(new MQClientException("wait response from " + addr + " timeout :" + responseFuture.getTimeoutMillis() + "ms" + " request: " + request, responseFuture.getCause())); } else { - pullCallback.onException(new MQClientException("unknow reseaon", responseFuture.getCause())); + pullCallback.onException(new MQClientException("unknown reason. addr: " + addr + ", timeoutMillis: " + timeoutMillis + ", request: " + request, responseFuture.getCause())); } } } From 790924535b168cc88b5b064c9aa2722aed8b4fee Mon Sep 17 00:00:00 2001 From: Jaskey Date: Fri, 14 Apr 2017 16:31:05 +0800 Subject: [PATCH 2/5] log when nameserver address list is updated --- .../org/apache/rocketmq/remoting/netty/NettyRemotingClient.java | 1 + 1 file changed, 1 insertion(+) diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java index d84f2a8188b..4c6b77cf6cf 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java @@ -321,6 +321,7 @@ public void updateNameServerAddressList(List addrs) { if (update) { Collections.shuffle(addrs); + log.info("name server address updated. NEW : {} , OLD: {}",addrs,old); this.namesrvAddrList.set(addrs); } } From c46e4c6e8bccaee3aeee2202fa04db378563f9f3 Mon Sep 17 00:00:00 2001 From: Jaskey Date: Fri, 14 Apr 2017 17:21:28 +0800 Subject: [PATCH 3/5] log when chosen nameserver address is updated --- .../org/apache/rocketmq/remoting/netty/NettyRemotingClient.java | 1 + 1 file changed, 1 insertion(+) diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java index 4c6b77cf6cf..4c37f6c7025 100644 --- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java +++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java @@ -399,6 +399,7 @@ private Channel getAndCreateNameserverChannel() throws InterruptedException { String newAddr = addrList.get(index); this.namesrvAddrChoosed.set(newAddr); + log.info("new name server is chosen. OLD: {} , NEW: {}. namesrvIndex = {}", addr, newAddr, namesrvIndex); Channel channelNew = this.createChannel(newAddr); if (channelNew != null) return channelNew; From ec7c8cdf0581f8ff51ba0e27dc1cbbde9fefdfb9 Mon Sep 17 00:00:00 2001 From: Jaskey Date: Mon, 17 Apr 2017 11:20:35 +0800 Subject: [PATCH 4/5] modify typo --- .../org/apache/rocketmq/client/impl/MQClientAPIImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java index 3c3884d1f22..b831c25031c 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java @@ -577,12 +577,12 @@ public void operationComplete(ResponseFuture responseFuture) { } } else { if (!responseFuture.isSendRequestOK()) { - pullCallback.onException(new MQClientException("send request failed to " + addr + ".request: " + request, responseFuture.getCause())); + pullCallback.onException(new MQClientException("send request failed to " + addr + ". Request: " + request, responseFuture.getCause())); } else if (responseFuture.isTimeout()) { - pullCallback.onException(new MQClientException("wait response from " + addr + " timeout :" + responseFuture.getTimeoutMillis() + "ms" + " request: " + request, + pullCallback.onException(new MQClientException("wait response from " + addr + " timeout :" + responseFuture.getTimeoutMillis() + "ms" + ". Request: " + request, responseFuture.getCause())); } else { - pullCallback.onException(new MQClientException("unknown reason. addr: " + addr + ", timeoutMillis: " + timeoutMillis + ", request: " + request, responseFuture.getCause())); + pullCallback.onException(new MQClientException("unknown reason. addr: " + addr + ", timeoutMillis: " + timeoutMillis + ". Request: " + request, responseFuture.getCause())); } } } From 1e8b575530f32bdb1fac17c906760b947385517d Mon Sep 17 00:00:00 2001 From: Jaskey Date: Mon, 17 Apr 2017 16:19:00 +0800 Subject: [PATCH 5/5] log topic when topic route info table is updated --- .../apache/rocketmq/client/impl/factory/MQClientInstance.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java b/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java index 1343e7639b6..672d7dbf02b 100644 --- a/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java +++ b/client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java @@ -596,7 +596,7 @@ public boolean updateTopicRouteInfoFromNameServer(final String topic, boolean is } } } - log.info("topicRouteTable.put TopicRouteData[{}]", cloneTopicRouteData); + log.info("topicRouteTable.put. Topic = {}, TopicRouteData[{}]", topic, cloneTopicRouteData); this.topicRouteTable.put(topic, cloneTopicRouteData); return true; }