zhisheng17 commented on a change in pull request #11822:
URL: https://github.com/apache/flink/pull/11822#discussion_r412132038
##########
File path:
flink-connectors/flink-connector-elasticsearch7/src/main/java/org/apache/flink/streaming/connectors/elasticsearch7/Elasticsearch7UpsertTableSink.java
##########
@@ -185,8 +191,18 @@ protected ElasticsearchUpsertTableSinkBase copy(
Optional.ofNullable(sinkOptions.get(BULK_FLUSH_BACKOFF_DELAY))
.ifPresent(v ->
builder.setBulkFlushBackoffDelay(Long.valueOf(v)));
- builder.setRestClientFactory(
- new
DefaultRestClientFactory(sinkOptions.get(REST_PATH_PREFIX)));
+ if
(Optional.ofNullable(sinkOptions.get(CONNECTOR_USERNAME)).isPresent() &&
+
Optional.ofNullable(sinkOptions.get(CONNECTOR_PASSWORD)).isPresent()) {
+ builder.setRestClientFactory(new AuthRestClientFactory(
+ sinkOptions.get(CONNECTOR_USERNAME),
+ sinkOptions.get(CONNECTOR_PASSWORD),
+ sinkOptions.get(REST_PATH_PREFIX)
+ ));
+ } else {
+ builder.setRestClientFactory(
+ new DefaultRestClientFactory(
Review comment:
@wuchong es7 RestClientBuilder don't have maxRetryTimeout fields
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]