Skip to content
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) {
}


}
}