diff --git a/src/main/java/io/opensergo/OpenSergoClient.java b/src/main/java/io/opensergo/OpenSergoClient.java index 1bf3b29..0eff4cc 100644 --- a/src/main/java/io/opensergo/OpenSergoClient.java +++ b/src/main/java/io/opensergo/OpenSergoClient.java @@ -53,7 +53,7 @@ public class OpenSergoClient implements AutoCloseable { public static class Builder { private String host; - private int port; + private int port = 10246; private OpenSergoClientConfig openSergoConfig; public OpenSergoClient.Builder endpoint(String host, int port) { @@ -83,6 +83,8 @@ public OpenSergoClient(String host, int port) { } public OpenSergoClient(String host, int port, OpenSergoClientConfig clientConfig) { + AssertUtils.notEmpty(host, "host cannot be empty, need to give a valid host"); + AssertUtils.isTrue(port < 1, "port < 1 is invalid, need to give a valid port"); checkClientConfig(clientConfig); // TODO: support TLS this.clientConfig = clientConfig;