Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"documentClass": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Class", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "ObjectNode", "description": "The full qualified name of the class of the document to unmarshall", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_DOCUMENT_CLASS" },
"waitForActiveShards": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The index creation waits for the write consistency number of shards to be available", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_WAIT_FOR_ACTIVE_SHARDS" },
"scrollKeepAliveMs": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The starting index of the response.", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_SCROLL_KEEP_ALIVE_MS" },
"useScroll": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Set to true to enable scroll usage", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_SCROLL" },
"useScroll": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Set to true to enable scroll usage. When enabled, the body is returned as a OpensearchScrollRequestIterator. Make sure to use the stream and close it accordingly to avoid potential resource leaks.", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_SCROLL" },
"size": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The size of the response.", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_SIZE" },
"from": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The starting index of the response.", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_FROM" }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"documentClass": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Class", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "ObjectNode", "description": "The full qualified name of the class of the document to unmarshall", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_DOCUMENT_CLASS" },
"waitForActiveShards": { "index": 4, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The index creation waits for the write consistency number of shards to be available", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_WAIT_FOR_ACTIVE_SHARDS" },
"scrollKeepAliveMs": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The starting index of the response.", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_SCROLL_KEEP_ALIVE_MS" },
"useScroll": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Set to true to enable scroll usage", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_SCROLL" },
"useScroll": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Set to true to enable scroll usage. When enabled, the body is returned as a OpensearchScrollRequestIterator. Make sure to use the stream and close it accordingly to avoid potential resource leaks.", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_SCROLL" },
"size": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The size of the response.", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_SIZE" },
"from": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The starting index of the response.", "constantName": "org.apache.camel.component.opensearch.OpensearchConstants#PARAM_FROM" }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public interface OpensearchConstants {
String PARAM_WAIT_FOR_ACTIVE_SHARDS = "waitForActiveShards";
@Metadata(description = "The starting index of the response.", javaType = "Integer")
String PARAM_SCROLL_KEEP_ALIVE_MS = "scrollKeepAliveMs";
@Metadata(description = "Set to true to enable scroll usage", javaType = "Boolean")
@Metadata(description = "Set to true to enable scroll usage. When enabled, the body is returned as a `OpensearchScrollRequestIterator`."
+
" Make sure to use the stream and close it accordingly to avoid potential resource leaks.",
javaType = "Boolean")
String PARAM_SCROLL = "useScroll";
@Metadata(description = "The size of the response.", javaType = "Integer")
String PARAM_SIZE = "size";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@ public boolean process(Exchange exchange, AsyncCallback callback) {
int scrollKeepAliveMs
= message.getHeader(PARAM_SCROLL_KEEP_ALIVE_MS, configuration.getScrollKeepAliveMs(),
Integer.class);
// NOTE: the stream must be closed by the client.
OpensearchScrollRequestIterator<?> scrollRequestIterator = new OpensearchScrollRequestIterator<>(
searchRequestBuilder, new OpenSearchClient(transport), scrollKeepAliveMs, exchange,
documentClass);
documentClass); // NOSONAR:
exchange.getIn().setBody(scrollRequestIterator);
cleanup(ctx);
callback.done(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,9 @@ public String scrollKeepAliveMs() {
return "scrollKeepAliveMs";
}
/**
* Set to true to enable scroll usage.
* Set to true to enable scroll usage. When enabled, the body is
* returned as a OpensearchScrollRequestIterator. Make sure to use the
* stream and close it accordingly to avoid potential resource leaks.
*
* The option is a: {@code Boolean} type.
*
Expand Down