You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/12/06 09:59:31 UTC

[camel-kamelets] 01/08: Added Solr Source Kamelet

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch solr-query
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 80b076d071428cb9149215e00ae6ee555e4607dc
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Dec 6 10:54:20 2021 +0100

    Added Solr Source Kamelet
---
 kamelets/solr-source.kamelet.yaml | 85 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/kamelets/solr-source.kamelet.yaml b/kamelets/solr-source.kamelet.yaml
new file mode 100644
index 0000000..f1d595d
--- /dev/null
+++ b/kamelets/solr-source.kamelet.yaml
@@ -0,0 +1,85 @@
+# ---------------------------------------------------------------------------
+# 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-source
+  annotations:
+    camel.apache.org/kamelet.support.level: "Preview"
+    camel.apache.org/catalog.version: "main-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"
+  labels:
+    camel.apache.org/kamelet.type: "source"
+spec:
+  definition:
+    title: "Solr Source"
+    description: |-
+      Query for documents to Solr Collection.
+    required:
+      - period
+      - servers
+      - collection
+      - query
+    type: object
+    properties:
+      period:
+        title: Period between Polls
+        description: The interval between fetches to the Solr collection
+        type: integer
+        default: 10000
+      collection:
+        title: Collection
+        description: Solr Collection name
+        type: string
+      servers:
+        title: Servers
+        description: Comma separated list of Solr Servers and ports
+        type: string
+      query:
+        title: Query
+        description: The query to submit to Solr
+        type: string
+  types:
+    in:
+      mediaType: application/json
+  dependencies:
+  - "camel:solr"
+  - "camel:core"
+  - "camel:jackson"
+  - "camel:kamelet"
+  flow:
+    from:
+      uri: "timer:solr-stream"
+      parameters:
+        period: "{{period}}"
+      steps:
+      - set-header:
+          name: "SolrOperation"
+          constant: "QUERY"
+      - set-header:
+          name: "CamelSolrQueryString"
+          constant: "{{query}}"
+      - remove-header:
+          name: "content-type"
+      - to:
+          uri: "solr:{{servers}}/solr/{{collection}}"
+      - marshal:
+          json:
+            library: Jackson
+      - to: "kamelet:sink"