This is an automated email from the ASF dual-hosted git repository.
oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
The following commit(s) were added to refs/heads/main by this push:
new a0e8f2fff chore: solr-sink and solr-source can connect over HTTPS
(#3170) (#3173)
a0e8f2fff is described below
commit a0e8f2fffd591ccd66794064f269bef104846d90
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Nov 18 09:55:39 2026 +0100
chore: solr-sink and solr-source can connect over HTTPS (#3170) (#3173)
Add the enableSSL option (default false, so plain HTTP as before) and the
certificate option (the certificate of Solr or of its CA, encoded in base64,
passed to camel-solr as certificatePath=RAW(base64:...)) to both Kamelets.
RAW keeps a base64 value with + or / intact. solr-source also gets the
optional size option (rows per query); unset, Solr returns 10 as before.
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
.../modules/ROOT/partials/solr-source-description.adoc | 10 +++++++---
kamelets/solr-sink.kamelet.yaml | 13 +++++++++++--
kamelets/solr-source.kamelet.yaml | 18 ++++++++++++++++--
.../src/main/resources/META-INF/kamelets-index.json | 4 ++--
.../src/main/resources/kamelets/solr-sink.kamelet.yaml | 13 +++++++++++--
.../main/resources/kamelets/solr-source.kamelet.yaml | 18 ++++++++++++++++--
6 files changed, 63 insertions(+), 13 deletions(-)
diff --git a/docs/modules/ROOT/partials/solr-source-description.adoc
b/docs/modules/ROOT/partials/solr-source-description.adoc
index 1ae65c521..189054f1b 100644
--- a/docs/modules/ROOT/partials/solr-source-description.adoc
+++ b/docs/modules/ROOT/partials/solr-source-description.adoc
@@ -1,12 +1,14 @@
== Solr Source Kamelet Description
-=== Authentication methods
+=== Connection and authentication
-This Kamelet connects to Solr over plain HTTP. For a Solr with Basic
authentication, set the `username` and `password` properties; leave them out
for a Solr without login.
+This Kamelet connects to Solr over plain HTTP by default. For a Solr that is
reached with HTTPS, set `enableSSL` to true. When Solr uses a self-signed
certificate, or one that Java does not trust, give the certificate of Solr, or
of the certificate authority that signed it, in `certificate`, encoded in
base64 on one line, for example with `base64 -w0 solr.crt`.
+
+For a Solr with Basic authentication, set the `username` and `password`
properties; leave them out for a Solr without login.
=== Output format
-The Kamelet runs the configured query at every `period`, and produces one
message per query: the answer of Solr as JSON text, with the documents found
under `response`. Every query returns all the matching documents again, not
only the new ones.
+The Kamelet runs the configured query at every `period`, and produces one
message per query: the answer of Solr as JSON text, with the documents found
under `response`. Every query returns all the matching documents again, not
only the new ones, but at most `size` of them, or 10 with the usual Solr
settings when `size` is not set.
=== Configuration
@@ -17,6 +19,8 @@ The Kamelet requires the following properties:
- `query`: the query, in the Solr query syntax, such as `status_s:new`
- `period`: the time between two queries, in milliseconds
+Optional properties include `size` (the most documents each query returns),
`enableSSL` and `certificate` (HTTPS), and `username` and `password` (Basic
authentication).
+
=== Usage example
[source,yaml,subs='+attributes,macros']
diff --git a/kamelets/solr-sink.kamelet.yaml b/kamelets/solr-sink.kamelet.yaml
index f8affcc44..bf01594a9 100644
--- a/kamelets/solr-sink.kamelet.yaml
+++ b/kamelets/solr-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
Output: when it is used inside a route, the body afterwards is the
answer of Solr, as a Map-like object with its `responseHeader`.
- Good to know: a body that is not JSON fails the message. With
`autocommit` false, the default, the documents become searchable only when Solr
commits them, as set in the configuration of the collection. It connects with
plain HTTP.
+ Good to know: a body that is not JSON fails the message. With
`autocommit` false, the default, the documents become searchable only when Solr
commits them, as set in the configuration of the collection. It connects with
plain HTTP by default; set `enableSSL` to true for a Solr that is reached with
HTTPS, and give the certificate in `certificate` when Solr uses a self-signed
certificate.
required:
- servers
- collection
@@ -73,6 +73,15 @@ spec:
format: password
x-descriptors:
- urn:camel:group:credentials
+ enableSSL:
+ title: Enable SSL
+ description: If true, it connects with HTTPS. Leave it false for a
Solr that is reached with plain HTTP.
+ type: boolean
+ default: false
+ certificate:
+ title: Certificate
+ description: The certificate of Solr, or of the certificate authority
(CA) that signed it, as a PEM or DER file encoded in base64 on one line, such
as the output of `base64 -w0 solr.crt` (`base64 -i solr.crt` on macOS). Needed
when Solr uses a self-signed certificate, or one that Java does not trust. When
it is not set, the certificates that Java trusts are used. Only used when
`enableSSL` is true.
+ type: string
types:
in:
mediaType: application/json
@@ -99,4 +108,4 @@ spec:
- removeHeader:
name: content-type
- to:
- uri:
"solr:{{servers}}/solr/?autocommit={{autocommit}}&password=RAW({{?password}})&username=RAW({{?username}})"
+ uri:
"solr:{{servers}}/solr/?autocommit={{autocommit}}&password=RAW({{?password}})&username=RAW({{?username}})&enableSSL={{enableSSL}}&certificatePath=RAW(base64:{{?certificate}})"
diff --git a/kamelets/solr-source.kamelet.yaml
b/kamelets/solr-source.kamelet.yaml
index 07d026226..0d7101329 100644
--- a/kamelets/solr-source.kamelet.yaml
+++ b/kamelets/solr-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
Output: the body is JSON text, the answer of Solr: `responseHeader`, and
under `response` the list of the documents found, each with its fields. The
`Content-Type` header is `application/json`.
- Good to know: every query returns all the matching documents again, not
only the new ones; filter on a date in the query to get only new documents.
Each query returns only the first documents found, 10 with the usual Solr
settings. It connects with plain HTTP.
+ Good to know: every query returns all the matching documents again, not
only the new ones; filter on a date in the query to get only new documents.
Each query returns only the first documents found: as many as `size`, or 10
with the usual Solr settings when `size` is not set. It connects with plain
HTTP by default; set `enableSSL` to true for a Solr that is reached with HTTPS,
and give the certificate in `certificate` when Solr uses a self-signed
certificate.
required:
- period
- servers
@@ -66,6 +66,11 @@ spec:
description: The query to run, in the Solr query syntax, as given in
the `q` parameter of a Solr search, such as `*:*` for every document or
`status_s:new`.
type: string
example: "status_s:new"
+ size:
+ title: Maximum Documents
+ description: The most documents each query returns, as the `rows`
parameter of a Solr search. When it is not set, Solr decides, which is 10 with
the usual Solr settings.
+ type: integer
+ example: 100
username:
title: Username
description: The Solr user to log in as, with Basic authentication.
Leave it out for a Solr without login.
@@ -79,6 +84,15 @@ spec:
format: password
x-descriptors:
- urn:camel:group:credentials
+ enableSSL:
+ title: Enable SSL
+ description: If true, it connects with HTTPS. Leave it false for a
Solr that is reached with plain HTTP.
+ type: boolean
+ default: false
+ certificate:
+ title: Certificate
+ description: The certificate of Solr, or of the certificate authority
(CA) that signed it, as a PEM or DER file encoded in base64 on one line, such
as the output of `base64 -w0 solr.crt` (`base64 -i solr.crt` on macOS). Needed
when Solr uses a self-signed certificate, or one that Java does not trust. When
it is not set, the certificates that Java trusts are used. Only used when
`enableSSL` is true.
+ type: string
types:
out:
mediaType: application/json
@@ -112,7 +126,7 @@ spec:
- removeHeader:
name: content-type
- to:
- uri:
"solr:{{servers}}/solr/?password=RAW({{?password}})&username=RAW({{?username}})"
+ uri:
"solr:{{servers}}/solr/?password=RAW({{?password}})&username=RAW({{?username}})&enableSSL={{enableSSL}}&certificatePath=RAW(base64:{{?certificate}})&size={{?size}}"
- marshal:
json:
library: Jackson
diff --git
a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
index 0a1992a28..44e2f8358 100644
--- a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
+++ b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
@@ -2125,7 +2125,7 @@
"supportLevel" : "Stable",
"title" : "Solr Sink",
"summary" : "Adds each message, a JSON object or a JSON array of objects,
as one or more documents to a collection or core of Apache Solr, so that they
can be searched.",
- "description" : "Adds each message, a JSON object or a JSON array of
objects, as one or more documents to a collection or core of Apache Solr, so
that they can be searched.\n\nUse it to make records searchable in Solr, such
as products, articles or orders. To run a query on a schedule, use
`solr-source`.\n\nInput: the body is JSON text: an object for one document,
such as `{\"id\": \"order-42\", \"status_s\": \"shipped\"}`, or an array of
objects for several. A document with the same [...]
+ "description" : "Adds each message, a JSON object or a JSON array of
objects, as one or more documents to a collection or core of Apache Solr, so
that they can be searched.\n\nUse it to make records searchable in Solr, such
as products, articles or orders. To run a query on a schedule, use
`solr-source`.\n\nInput: the body is JSON text: an object for one document,
such as `{\"id\": \"order-42\", \"status_s\": \"shipped\"}`, or an array of
objects for several. A document with the same [...]
"group" : "Solr",
"namespace" : "Search",
"provider" : "Apache Software Foundation"
@@ -2135,7 +2135,7 @@
"supportLevel" : "Stable",
"title" : "Solr Source",
"summary" : "Runs the same query on a collection or core of Apache Solr at
a regular interval, and sends the result of each query as one message.",
- "description" : "Runs the same query on a collection or core of Apache
Solr at a regular interval, and sends the result of each query as one
message.\n\nUse it to watch a Solr collection on a schedule, for example to
send the documents that match a query to another system. To add documents to
Solr, use `solr-sink`.\n\nOutput: the body is JSON text, the answer of Solr:
`responseHeader`, and under `response` the list of the documents found, each
with its fields. The `Content-Type` head [...]
+ "description" : "Runs the same query on a collection or core of Apache
Solr at a regular interval, and sends the result of each query as one
message.\n\nUse it to watch a Solr collection on a schedule, for example to
send the documents that match a query to another system. To add documents to
Solr, use `solr-sink`.\n\nOutput: the body is JSON text, the answer of Solr:
`responseHeader`, and under `response` the list of the documents found, each
with its fields. The `Content-Type` head [...]
"group" : "Solr",
"namespace" : "Search",
"provider" : "Apache Software Foundation"
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
index f8affcc44..bf01594a9 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/solr-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/solr-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
Output: when it is used inside a route, the body afterwards is the
answer of Solr, as a Map-like object with its `responseHeader`.
- Good to know: a body that is not JSON fails the message. With
`autocommit` false, the default, the documents become searchable only when Solr
commits them, as set in the configuration of the collection. It connects with
plain HTTP.
+ Good to know: a body that is not JSON fails the message. With
`autocommit` false, the default, the documents become searchable only when Solr
commits them, as set in the configuration of the collection. It connects with
plain HTTP by default; set `enableSSL` to true for a Solr that is reached with
HTTPS, and give the certificate in `certificate` when Solr uses a self-signed
certificate.
required:
- servers
- collection
@@ -73,6 +73,15 @@ spec:
format: password
x-descriptors:
- urn:camel:group:credentials
+ enableSSL:
+ title: Enable SSL
+ description: If true, it connects with HTTPS. Leave it false for a
Solr that is reached with plain HTTP.
+ type: boolean
+ default: false
+ certificate:
+ title: Certificate
+ description: The certificate of Solr, or of the certificate authority
(CA) that signed it, as a PEM or DER file encoded in base64 on one line, such
as the output of `base64 -w0 solr.crt` (`base64 -i solr.crt` on macOS). Needed
when Solr uses a self-signed certificate, or one that Java does not trust. When
it is not set, the certificates that Java trusts are used. Only used when
`enableSSL` is true.
+ type: string
types:
in:
mediaType: application/json
@@ -99,4 +108,4 @@ spec:
- removeHeader:
name: content-type
- to:
- uri:
"solr:{{servers}}/solr/?autocommit={{autocommit}}&password=RAW({{?password}})&username=RAW({{?username}})"
+ uri:
"solr:{{servers}}/solr/?autocommit={{autocommit}}&password=RAW({{?password}})&username=RAW({{?username}})&enableSSL={{enableSSL}}&certificatePath=RAW(base64:{{?certificate}})"
diff --git
a/library/camel-kamelets/src/main/resources/kamelets/solr-source.kamelet.yaml
b/library/camel-kamelets/src/main/resources/kamelets/solr-source.kamelet.yaml
index 07d026226..0d7101329 100644
---
a/library/camel-kamelets/src/main/resources/kamelets/solr-source.kamelet.yaml
+++
b/library/camel-kamelets/src/main/resources/kamelets/solr-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
Output: the body is JSON text, the answer of Solr: `responseHeader`, and
under `response` the list of the documents found, each with its fields. The
`Content-Type` header is `application/json`.
- Good to know: every query returns all the matching documents again, not
only the new ones; filter on a date in the query to get only new documents.
Each query returns only the first documents found, 10 with the usual Solr
settings. It connects with plain HTTP.
+ Good to know: every query returns all the matching documents again, not
only the new ones; filter on a date in the query to get only new documents.
Each query returns only the first documents found: as many as `size`, or 10
with the usual Solr settings when `size` is not set. It connects with plain
HTTP by default; set `enableSSL` to true for a Solr that is reached with HTTPS,
and give the certificate in `certificate` when Solr uses a self-signed
certificate.
required:
- period
- servers
@@ -66,6 +66,11 @@ spec:
description: The query to run, in the Solr query syntax, as given in
the `q` parameter of a Solr search, such as `*:*` for every document or
`status_s:new`.
type: string
example: "status_s:new"
+ size:
+ title: Maximum Documents
+ description: The most documents each query returns, as the `rows`
parameter of a Solr search. When it is not set, Solr decides, which is 10 with
the usual Solr settings.
+ type: integer
+ example: 100
username:
title: Username
description: The Solr user to log in as, with Basic authentication.
Leave it out for a Solr without login.
@@ -79,6 +84,15 @@ spec:
format: password
x-descriptors:
- urn:camel:group:credentials
+ enableSSL:
+ title: Enable SSL
+ description: If true, it connects with HTTPS. Leave it false for a
Solr that is reached with plain HTTP.
+ type: boolean
+ default: false
+ certificate:
+ title: Certificate
+ description: The certificate of Solr, or of the certificate authority
(CA) that signed it, as a PEM or DER file encoded in base64 on one line, such
as the output of `base64 -w0 solr.crt` (`base64 -i solr.crt` on macOS). Needed
when Solr uses a self-signed certificate, or one that Java does not trust. When
it is not set, the certificates that Java trusts are used. Only used when
`enableSSL` is true.
+ type: string
types:
out:
mediaType: application/json
@@ -112,7 +126,7 @@ spec:
- removeHeader:
name: content-type
- to:
- uri:
"solr:{{servers}}/solr/?password=RAW({{?password}})&username=RAW({{?username}})"
+ uri:
"solr:{{servers}}/solr/?password=RAW({{?password}})&username=RAW({{?username}})&enableSSL={{enableSSL}}&certificatePath=RAW(base64:{{?certificate}})&size={{?size}}"
- marshal:
json:
library: Jackson