This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit 8c57b2ce0cd26c1c5932b5ac1db0bb043b7f7db5 Author: Andrea Cosentino <[email protected]> AuthorDate: Fri Apr 4 14:47:30 2025 +0200 Re-introduce Solr Kamelets - Solr Sink Signed-off-by: Andrea Cosentino <[email protected]> --- kamelets/solr-sink.kamelet.yaml | 96 ++++++++++++++++++++++ .../main/resources/kamelets/solr-sink.kamelet.yaml | 96 ++++++++++++++++++++++ 2 files changed, 192 insertions(+) diff --git a/kamelets/solr-sink.kamelet.yaml b/kamelets/solr-sink.kamelet.yaml new file mode 100644 index 000000000..1f3c57f89 --- /dev/null +++ b/kamelets/solr-sink.kamelet.yaml @@ -0,0 +1,96 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: solr-sink + annotations: + camel.apache.org/kamelet.support.level: "Stable" + camel.apache.org/catalog.version: "4.11.0-SNAPSHOT" + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iODAwIiB3aWR0aD0iMTIwMCIgdmlld0JveD0iLTQwLjYwMDk1IC0zNC4yMTc3NSAzNTEuODc0OSAyMDUuMzA2NSI+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIiBjbGlwUGF0aFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTTAgMTAyLjY1NGgyMDMuMDA1VjBIMHoiLz48L2NsaXBQYXRoPjwvZGVmcz48ZyBjbGlwLXBhdGg9InVybCgjYSkiIHRyYW5zZm9ybT0ibWF0cml4KDEuMzMzMzMgMCAwIC0xLjMzMzMzIDAgMTM2Ljg3MSkiPjxwYXRoIGQ9Ik00MC43NiAzMS43NjNjLTIuMz [...] + camel.apache.org/provider: "Apache Software Foundation" + camel.apache.org/kamelet.group: "Solr" + camel.apache.org/kamelet.namespace: "Search" + labels: + camel.apache.org/kamelet.type: "sink" +spec: + definition: + title: "Solr Sink" + description: |- + Send documents to Solr Collection. + required: + - servers + - collection + type: object + properties: + collection: + title: Collection + description: Solr Collection name + type: string + servers: + title: Servers + description: Comma separated list of Solr Servers and ports + type: string + autocommit: + title: Autocommit + description: If autocommit should be enabled or not + type: boolean + default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' + username: + title: Username + description: Username to connect to Solr. + type: string + x-descriptors: + - urn:camel:group:credentials + password: + title: Password + description: Password to connect to Solr. + type: string + format: password + x-descriptors: + - urn:camel:group:credentials + types: + in: + mediaType: application/json + dependencies: + - "camel:solr" + - "camel:core" + - "camel:jackson" + - "camel:kamelet" + template: + from: + uri: "kamelet:source" + steps: + - setHeader: + name: "CamelSolrOperation" + constant: "INSERT" + - setHeader: + name: "CamelSolrCollection" + constant: "{{collection}}" + - unmarshal: + json: + library: Jackson + - removeHeader: + name: "content-type" + - to: + uri: "solr:{{servers}}/solr/" + parameters: + autocommit: "{{autocommit}}" + username: "{{?username}}" + password: "{{?password}}" diff --git a/library/camel-kamelets/src/main/resources/kamelets/solr-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/solr-sink.kamelet.yaml new file mode 100644 index 000000000..1f3c57f89 --- /dev/null +++ b/library/camel-kamelets/src/main/resources/kamelets/solr-sink.kamelet.yaml @@ -0,0 +1,96 @@ +# --------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# --------------------------------------------------------------------------- +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: solr-sink + annotations: + camel.apache.org/kamelet.support.level: "Stable" + camel.apache.org/catalog.version: "4.11.0-SNAPSHOT" + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iODAwIiB3aWR0aD0iMTIwMCIgdmlld0JveD0iLTQwLjYwMDk1IC0zNC4yMTc3NSAzNTEuODc0OSAyMDUuMzA2NSI+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIiBjbGlwUGF0aFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTTAgMTAyLjY1NGgyMDMuMDA1VjBIMHoiLz48L2NsaXBQYXRoPjwvZGVmcz48ZyBjbGlwLXBhdGg9InVybCgjYSkiIHRyYW5zZm9ybT0ibWF0cml4KDEuMzMzMzMgMCAwIC0xLjMzMzMzIDAgMTM2Ljg3MSkiPjxwYXRoIGQ9Ik00MC43NiAzMS43NjNjLTIuMz [...] + camel.apache.org/provider: "Apache Software Foundation" + camel.apache.org/kamelet.group: "Solr" + camel.apache.org/kamelet.namespace: "Search" + labels: + camel.apache.org/kamelet.type: "sink" +spec: + definition: + title: "Solr Sink" + description: |- + Send documents to Solr Collection. + required: + - servers + - collection + type: object + properties: + collection: + title: Collection + description: Solr Collection name + type: string + servers: + title: Servers + description: Comma separated list of Solr Servers and ports + type: string + autocommit: + title: Autocommit + description: If autocommit should be enabled or not + type: boolean + default: false + x-descriptors: + - 'urn:alm:descriptor:com.tectonic.ui:checkbox' + username: + title: Username + description: Username to connect to Solr. + type: string + x-descriptors: + - urn:camel:group:credentials + password: + title: Password + description: Password to connect to Solr. + type: string + format: password + x-descriptors: + - urn:camel:group:credentials + types: + in: + mediaType: application/json + dependencies: + - "camel:solr" + - "camel:core" + - "camel:jackson" + - "camel:kamelet" + template: + from: + uri: "kamelet:source" + steps: + - setHeader: + name: "CamelSolrOperation" + constant: "INSERT" + - setHeader: + name: "CamelSolrCollection" + constant: "{{collection}}" + - unmarshal: + json: + library: Jackson + - removeHeader: + name: "content-type" + - to: + uri: "solr:{{servers}}/solr/" + parameters: + autocommit: "{{autocommit}}" + username: "{{?username}}" + password: "{{?password}}"
