I have an Elasticsearch exception I have created a simple API where I am using the reactive mongo repository to find the data from the DB and I am trying to send this data to Elasticsearch which save operation one by one. So could you please tell the issue.
@Bean(name = ["highLevelClient"], destroyMethod = "close")
fun client(): RestHighLevelClient? {
val restBuilder: RestClientBuilder = RestClient
.builder(
HttpHost(
host,
port.toInt(),
scheme
)
)
if ((username != null) and (password != null)) {
val creadential: CredentialsProvider = BasicCredentialsProvider()
creadential.setCredentials(AuthScope.ANY, UsernamePasswordCredentials(username, password))
restBuilder.setHttpClientConfigCallback { httpClientBuilder ->
httpClientBuilder.setDefaultCredentialsProvider(creadential)
.setDefaultIOReactorConfig(IOReactorConfig.custom().setIoThreadCount(1).build())
}
restBuilder.setRequestConfigCallback { requestConfigBuilder: RequestConfig.Builder ->
requestConfigBuilder.setConnectTimeout(connectionTimeOut.toInt()) // time until a connection with the server is established.
.setSocketTimeout(socketTimeOut.toInt()) // time of inactivity to wait for packets[data] to receive.
.setConnectionRequestTimeout(connReqTimeOut.toInt())
} // time to fetch a connection from the connection pool 0 for infinite.
return RestHighLevelClient(restBuilder)
}
return null
}
this is my configuration to set up Elasticsearch.
Please tell me if you want any other code.