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 04658be1e Fix #2249: stop the pulsar serviceUrl being URI-decoded
twice (#2999)
04658be1e is described below
commit 04658be1ee9a9f0be7a8b7528df612b3b30a9ee4
Author: Andrea Cosentino <[email protected]>
AuthorDate: Thu Sep 3 18:34:07 2026 +0200
Fix #2249: stop the pulsar serviceUrl being URI-decoded twice (#2999)
serviceUrl was interpolated raw into the pulsar endpoint URI, so its value
went through query parameter decoding twice: once for the kamelet: URI the
caller writes, and again when the template builds pulsar:...?serviceUrl=.
A "+" survives the first pass and becomes a space on the second, so the
common pulsar+ssl:// scheme arrives at the client as "pulsar ssl://":
Invalid service-url pulsar ssl://localhost:1234 provided
java.net.URISyntaxException: Illegal character in scheme name at index 6
Still reproduces on 4.21, two years after the report on 4.8.
Wrapping the placeholder in RAW() inside the template protects the value on
the inner hop, which is where the second decode happened. Verified both
ways against the real component:
serviceUrl=pulsar+ssl://localhost:1234 -> resolves intact
serviceUrl=RAW(pulsar+ssl://localhost:1234) -> resolves intact
so the plain value now works as users expect, and the double-RAW workaround
from the issue keeps working rather than breaking. The Pulsar client
confirms the scheme survives:
No available hosts found for service url: pulsar+ssl://localhost:1234
pulsar-source carried the identical interpolation and is fixed with it.
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
---
kamelets/pulsar-sink.kamelet.yaml | 2 +-
kamelets/pulsar-source.kamelet.yaml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kamelets/pulsar-sink.kamelet.yaml
b/kamelets/pulsar-sink.kamelet.yaml
index b87d8b125..db491cb07 100644
--- a/kamelets/pulsar-sink.kamelet.yaml
+++ b/kamelets/pulsar-sink.kamelet.yaml
@@ -135,7 +135,7 @@ spec:
- to:
uri: pulsar:{{topicType}}/{{tenant}}/{{namespaceName}}/{{topic}}
parameters:
- serviceUrl: "{{serviceUrl}}"
+ serviceUrl: "RAW({{serviceUrl}})"
authenticationClass: "{{?authenticationClass}}"
authenticationParams: "{{?authenticationParams}}"
batchingEnabled: "{{?batchingEnabled}}"
diff --git a/kamelets/pulsar-source.kamelet.yaml
b/kamelets/pulsar-source.kamelet.yaml
index b7b60310c..9d39bcf0f 100644
--- a/kamelets/pulsar-source.kamelet.yaml
+++ b/kamelets/pulsar-source.kamelet.yaml
@@ -147,7 +147,7 @@ spec:
from:
uri: pulsar:{{topicType}}/{{tenant}}/{{namespaceName}}/{{topic}}
parameters:
- serviceUrl: "{{serviceUrl}}"
+ serviceUrl: "RAW({{serviceUrl}})"
authenticationClass: "{{?authenticationClass}}"
authenticationParams: "{{?authenticationParams}}"
consumerNamePrefix: "{{?consumerNamePrefix}}"