我正在尝试将elasticsearch添加为接收器,并且我当前的elasticsearch已启用SSL和基本身份验证。
我无法通过基本身份验证连接到elasticsearch。
错误日志:
错误:找不到(70,7):值restClientBuilder restClientBuilder-> {
使用的应用程序版本
scala-2.11
flink-1.7
elasticsearch-6.5
elasticsearch连接器版本-2.11
val credentialsProvider = new BasicCredentialsProvider
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("user", "password"))
esSinkBuilder.setRestClientFactory(
restClientBuilder -> {
restClientBuilder.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback()
{ override def customizeHttpClient(httpClientBuilder: HttpAsyncClientBuilder) = httpClientBuilder .setDefaultCredentialsProvider(credentialsProvider) }
)
}
)