pl.allegro.tech.hermes.management.domain.health.NodeDataProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hermes-management Show documentation
Show all versions of hermes-management Show documentation
Fast and reliable message broker built on top of Kafka.
package pl.allegro.tech.hermes.management.domain.health;
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
class NodeDataProvider {
private final String serverPort;
NodeDataProvider(@Value("${server.port}") String serverPort) {
this.serverPort = serverPort;
}
String getHostname() {
try {
return InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
throw new CouldNotResolveHostNameException(e);
}
}
String getServerPort() {
return serverPort;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy