Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当配置域名错误时提示域名解析异常,而不是提示:topic找不到 #313

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 @@ -121,10 +121,11 @@ public TopicMetadata updateTopicMetadata(String topic, String app) {
} catch (Exception e) {
logger.error("update topic metadata exception, topic: {}, app: {}", topic, app, e);

if (metadataCacheManager.getTopicMetadata(topic, app) == null) {
metadataCacheManager.putTopicMetadata(topic, app, new TopicMetadata(JoyQueueCode.CN_SERVICE_NOT_AVAILABLE));
}
return null;
// if (metadataCacheManager.getTopicMetadata(topic, app) == null) {
// metadataCacheManager.putTopicMetadata(topic, app, new TopicMetadata(JoyQueueCode.CN_SERVICE_NOT_AVAILABLE));
// }
// return null;
throw e;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ public static String toAddress(final SocketAddress address) {
InetSocketAddress isa = (InetSocketAddress) address;
StringBuilder builder = new StringBuilder(50);
if (address instanceof InetSocketAddress) {
InetAddress ia = isa.getAddress();
if (ia == null) {
throw new RuntimeException("UnknownHost[" + ((InetSocketAddress) address).getHostName() + "]");
}
builder.append(isa.getAddress().getHostAddress());
String separator = isValidIpV4Address(((InetSocketAddress) address).getHostString()) ? IPV4_PORT_SEPARATOR : IPV6_PORT_SEPARATOR;
builder.append(separator).append(isa.getPort());
Expand Down Expand Up @@ -986,4 +990,4 @@ public static boolean isValidIpV4Address(String value) {
}


}
}