你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
rochy - rochy_he
赞同来自:
public static RestClientBuilder getRestClientBuilder(int port, String user, String pwd, String... ips) { HttpHost[] httpHosts = new HttpHost[ips.length]; for (int i = 0; i < ips.length; i++) { String ip = ips[i]; httpHosts[i] = new HttpHost(ip, port, "http"); } String esAuth = ""; if (StrUtil.isNotBlank(user) && StrUtil.isNotBlank(pwd)) { esAuth = "Basic " + Base64.encode(user + ":" + pwd); } Header[] defaultHeaders = new Header[]{new BasicHeader("Authorization", esAuth)}; RestClientBuilder clientBuilder = RestClient.builder(httpHosts); clientBuilder.setDefaultHeaders(defaultHeaders); clientBuilder.setRequestConfigCallback(requestConfigBuilder -> requestConfigBuilder .setConnectTimeout(5000) .setSocketTimeout(150000)) .setMaxRetryTimeoutMillis(150000); return clientBuilder; }
要回复问题请先登录或注册
I walk like a shadow
1 个回复
rochy - rochy_he
赞同来自: