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.git
The following commit(s) were added to refs/heads/main by this push:
new 7ade7d307933 CAMEL-23895: camel-azure-servicebus - document RAW()
usage for connectionString (#24846)
7ade7d307933 is described below
commit 7ade7d307933f906301c1f93fdbd4f655b343389
Author: Andrea Cosentino <[email protected]>
AuthorDate: Fri Jul 17 15:04:41 2026 +0200
CAMEL-23895: camel-azure-servicebus - document RAW() usage for
connectionString (#24846)
A connection string SharedAccessKey is a Base64 value that often contains
characters with a special meaning in URIs (plus, slash, equals). Configured
directly in an endpoint URI without RAW(), authentication fails with a 401
InvalidSignature AMQP error. Emphasize RAW() usage in the component docs and
in the connectionString option description.
Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Andrea Cosentino <[email protected]>
---
.../camel/catalog/components/azure-servicebus.json | 4 ++--
.../component/azure/servicebus/azure-servicebus.json | 4 ++--
.../src/main/docs/azure-servicebus-component.adoc | 16 ++++++++++++++++
.../azure/servicebus/ServiceBusConfiguration.java | 5 ++++-
.../dsl/AzureServicebusComponentBuilderFactory.java | 6 +++++-
.../endpoint/dsl/ServiceBusEndpointBuilderFactory.java | 18 +++++++++++++++---
6 files changed, 44 insertions(+), 9 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/azure-servicebus.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/azure-servicebus.json
index f5124b902482..117976bbd7e0 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/azure-servicebus.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/azure-servicebus.json
@@ -49,7 +49,7 @@
"serviceBusTransactionContext": { "index": 22, "kind": "property",
"displayName": "Service Bus Transaction Context", "group": "producer", "label":
"producer", "required": false, "type": "object", "javaType":
"com.azure.messaging.servicebus.ServiceBusTransactionContext", "deprecated":
false, "autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Represents [...]
"sessionId": { "index": 23, "kind": "property", "displayName": "Session
Id", "group": "producer", "label": "producer", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": false, "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Session ID for
session-enabled queues or topics." },
"autowiredEnabled": { "index": 24, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching [...]
- "connectionString": { "index": 25, "kind": "property", "displayName":
"Connection String", "group": "security", "label": "security", "required":
false, "type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": true, "security": "secret", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Sets the connection
string for a Service Bus namespace or a [...]
+ "connectionString": { "index": 25, "kind": "property", "displayName":
"Connection String", "group": "security", "label": "security", "required":
false, "type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": true, "security": "secret", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Sets the connection
string for a Service Bus namespace or a [...]
"credentialType": { "index": 26, "kind": "property", "displayName":
"Credential Type", "group": "security", "label": "security", "required": false,
"type": "enum", "javaType":
"org.apache.camel.component.azure.servicebus.CredentialType", "enum": [
"AZURE_IDENTITY", "CONNECTION_STRING", "TOKEN_CREDENTIAL" ], "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"CONNECTION_STRING", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfigu [...]
"fullyQualifiedNamespace": { "index": 27, "kind": "property",
"displayName": "Fully Qualified Namespace", "group": "security", "label":
"security", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Fully Qualified
Namespace of the service bus" },
"tokenCredential": { "index": 28, "kind": "property", "displayName":
"Token Credential", "group": "security", "label": "security", "required":
false, "type": "object", "javaType":
"com.azure.core.credential.TokenCredential", "deprecated": false,
"deprecationNote": "", "autowired": true, "secret": true, "security": "secret",
"configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "A TokenCredent [...]
@@ -108,7 +108,7 @@
"serviceBusTransactionContext": { "index": 23, "kind": "parameter",
"displayName": "Service Bus Transaction Context", "group": "producer", "label":
"producer", "required": false, "type": "object", "javaType":
"com.azure.messaging.servicebus.ServiceBusTransactionContext", "deprecated":
false, "autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Represents [...]
"sessionId": { "index": 24, "kind": "parameter", "displayName": "Session
Id", "group": "producer", "label": "producer", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": false, "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Session ID for
session-enabled queues or topics." },
"lazyStartProducer": { "index": 25, "kind": "parameter", "displayName":
"Lazy Start Producer", "group": "producer (advanced)", "label":
"producer,advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "Whether the producer should be started
lazy (on the first message). By starting lazy you can use this to allow
CamelContext and routes to startup in situations where a produ [...]
- "connectionString": { "index": 26, "kind": "parameter", "displayName":
"Connection String", "group": "security", "label": "security", "required":
false, "type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": true, "security": "secret", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Sets the connection
string for a Service Bus namespace or [...]
+ "connectionString": { "index": 26, "kind": "parameter", "displayName":
"Connection String", "group": "security", "label": "security", "required":
false, "type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": true, "security": "secret", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Sets the connection
string for a Service Bus namespace or [...]
"credentialType": { "index": 27, "kind": "parameter", "displayName":
"Credential Type", "group": "security", "label": "security", "required": false,
"type": "enum", "javaType":
"org.apache.camel.component.azure.servicebus.CredentialType", "enum": [
"AZURE_IDENTITY", "CONNECTION_STRING", "TOKEN_CREDENTIAL" ], "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"CONNECTION_STRING", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfig [...]
"fullyQualifiedNamespace": { "index": 28, "kind": "parameter",
"displayName": "Fully Qualified Namespace", "group": "security", "label":
"security", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Fully Qualified
Namespace of the service bus" },
"tokenCredential": { "index": 29, "kind": "parameter", "displayName":
"Token Credential", "group": "security", "label": "security", "required":
false, "type": "object", "javaType":
"com.azure.core.credential.TokenCredential", "deprecated": false,
"deprecationNote": "", "autowired": true, "secret": true, "security": "secret",
"configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "A TokenCreden [...]
diff --git
a/components/camel-azure/camel-azure-servicebus/src/generated/resources/META-INF/org/apache/camel/component/azure/servicebus/azure-servicebus.json
b/components/camel-azure/camel-azure-servicebus/src/generated/resources/META-INF/org/apache/camel/component/azure/servicebus/azure-servicebus.json
index f5124b902482..117976bbd7e0 100644
---
a/components/camel-azure/camel-azure-servicebus/src/generated/resources/META-INF/org/apache/camel/component/azure/servicebus/azure-servicebus.json
+++
b/components/camel-azure/camel-azure-servicebus/src/generated/resources/META-INF/org/apache/camel/component/azure/servicebus/azure-servicebus.json
@@ -49,7 +49,7 @@
"serviceBusTransactionContext": { "index": 22, "kind": "property",
"displayName": "Service Bus Transaction Context", "group": "producer", "label":
"producer", "required": false, "type": "object", "javaType":
"com.azure.messaging.servicebus.ServiceBusTransactionContext", "deprecated":
false, "autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Represents [...]
"sessionId": { "index": 23, "kind": "property", "displayName": "Session
Id", "group": "producer", "label": "producer", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": false, "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Session ID for
session-enabled queues or topics." },
"autowiredEnabled": { "index": 24, "kind": "property", "displayName":
"Autowired Enabled", "group": "advanced", "label": "advanced", "required":
false, "type": "boolean", "javaType": "boolean", "deprecated": false,
"autowired": false, "secret": false, "defaultValue": true, "description":
"Whether autowiring is enabled. This is used for automatic autowiring options
(the option must be marked as autowired) by looking up in the registry to find
if there is a single instance of matching [...]
- "connectionString": { "index": 25, "kind": "property", "displayName":
"Connection String", "group": "security", "label": "security", "required":
false, "type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": true, "security": "secret", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Sets the connection
string for a Service Bus namespace or a [...]
+ "connectionString": { "index": 25, "kind": "property", "displayName":
"Connection String", "group": "security", "label": "security", "required":
false, "type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": true, "security": "secret", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Sets the connection
string for a Service Bus namespace or a [...]
"credentialType": { "index": 26, "kind": "property", "displayName":
"Credential Type", "group": "security", "label": "security", "required": false,
"type": "enum", "javaType":
"org.apache.camel.component.azure.servicebus.CredentialType", "enum": [
"AZURE_IDENTITY", "CONNECTION_STRING", "TOKEN_CREDENTIAL" ], "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"CONNECTION_STRING", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfigu [...]
"fullyQualifiedNamespace": { "index": 27, "kind": "property",
"displayName": "Fully Qualified Namespace", "group": "security", "label":
"security", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Fully Qualified
Namespace of the service bus" },
"tokenCredential": { "index": 28, "kind": "property", "displayName":
"Token Credential", "group": "security", "label": "security", "required":
false, "type": "object", "javaType":
"com.azure.core.credential.TokenCredential", "deprecated": false,
"deprecationNote": "", "autowired": true, "secret": true, "security": "secret",
"configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "A TokenCredent [...]
@@ -108,7 +108,7 @@
"serviceBusTransactionContext": { "index": 23, "kind": "parameter",
"displayName": "Service Bus Transaction Context", "group": "producer", "label":
"producer", "required": false, "type": "object", "javaType":
"com.azure.messaging.servicebus.ServiceBusTransactionContext", "deprecated":
false, "autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Represents [...]
"sessionId": { "index": 24, "kind": "parameter", "displayName": "Session
Id", "group": "producer", "label": "producer", "required": false, "type":
"string", "javaType": "java.lang.String", "deprecated": false, "autowired":
false, "secret": false, "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Session ID for
session-enabled queues or topics." },
"lazyStartProducer": { "index": 25, "kind": "parameter", "displayName":
"Lazy Start Producer", "group": "producer (advanced)", "label":
"producer,advanced", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "Whether the producer should be started
lazy (on the first message). By starting lazy you can use this to allow
CamelContext and routes to startup in situations where a produ [...]
- "connectionString": { "index": 26, "kind": "parameter", "displayName":
"Connection String", "group": "security", "label": "security", "required":
false, "type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": true, "security": "secret", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Sets the connection
string for a Service Bus namespace or [...]
+ "connectionString": { "index": 26, "kind": "parameter", "displayName":
"Connection String", "group": "security", "label": "security", "required":
false, "type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": true, "security": "secret", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Sets the connection
string for a Service Bus namespace or [...]
"credentialType": { "index": 27, "kind": "parameter", "displayName":
"Credential Type", "group": "security", "label": "security", "required": false,
"type": "enum", "javaType":
"org.apache.camel.component.azure.servicebus.CredentialType", "enum": [
"AZURE_IDENTITY", "CONNECTION_STRING", "TOKEN_CREDENTIAL" ], "deprecated":
false, "autowired": false, "secret": false, "defaultValue":
"CONNECTION_STRING", "configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfig [...]
"fullyQualifiedNamespace": { "index": 28, "kind": "parameter",
"displayName": "Fully Qualified Namespace", "group": "security", "label":
"security", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "Fully Qualified
Namespace of the service bus" },
"tokenCredential": { "index": 29, "kind": "parameter", "displayName":
"Token Credential", "group": "security", "label": "security", "required":
false, "type": "object", "javaType":
"com.azure.core.credential.TokenCredential", "deprecated": false,
"deprecationNote": "", "autowired": true, "secret": true, "security": "secret",
"configurationClass":
"org.apache.camel.component.azure.servicebus.ServiceBusConfiguration",
"configurationField": "configuration", "description": "A TokenCreden [...]
diff --git
a/components/camel-azure/camel-azure-servicebus/src/main/docs/azure-servicebus-component.adoc
b/components/camel-azure/camel-azure-servicebus/src/main/docs/azure-servicebus-component.adoc
index be5092ffb3f6..33231112caa2 100644
---
a/components/camel-azure/camel-azure-servicebus/src/main/docs/azure-servicebus-component.adoc
+++
b/components/camel-azure/camel-azure-servicebus/src/main/docs/azure-servicebus-component.adoc
@@ -55,6 +55,22 @@ To use this component, you have three options to provide the
required Azure auth
- Provide `connectionString` string it is the simplest option to get started.
+[IMPORTANT]
+====
+The `SharedAccessKey` part of a connection string is a Base64-encoded value
that often contains characters with a
+special meaning in URIs (such as `+`, `/` or `=`). When the `connectionString`
is configured directly in an endpoint
+URI (including the Endpoint DSL), wrap the value with `RAW()` so it is not
URI-decoded, otherwise authentication
+fails with `status-code: 401 ... InvalidSignature: The token has an invalid
signature`:
+
+[source,java]
+----
+from("azure-servicebus:myQueue?connectionString=RAW(Endpoint=sb://myhost.servicebus.windows.net/;SharedAccessKeyName=test;SharedAccessKey=aBc+dEf/123=)")
+ .to("mock:result");
+----
+
+See
xref:manual::endpoint.adoc#_configuring_parameter_values_using_raw_values_such_as_passwords[Configuring
parameter values using raw values] for more details.
+====
+
*TOKEN_CREDENTIAL*:
- Provide an implementation of `com.azure.core.credential.TokenCredential`
into the Camel's Registry, e.g., using the
`com.azure.identity.DefaultAzureCredentialBuilder().build();` API.
diff --git
a/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/ServiceBusConfiguration.java
b/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/ServiceBusConfiguration.java
index 91bc594bc3b4..d9e8d836911e 100644
---
a/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/ServiceBusConfiguration.java
+++
b/components/camel-azure/camel-azure-servicebus/src/main/java/org/apache/camel/component/azure/servicebus/ServiceBusConfiguration.java
@@ -141,7 +141,10 @@ public class ServiceBusConfiguration implements Cloneable,
HeaderFilterStrategyA
}
/**
- * Sets the connection string for a Service Bus namespace or a specific
Service Bus resource.
+ * Sets the connection string for a Service Bus namespace or a specific
Service Bus resource. Connection strings
+ * commonly contain characters with a special meaning in URIs (the
SharedAccessKey is a Base64 value that may
+ * contain plus, slash or equals characters): when configuring the
connection string directly in an endpoint URI,
+ * wrap the value with RAW() so it is not URI-decoded.
*/
public String getConnectionString() {
return connectionString;
diff --git
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AzureServicebusComponentBuilderFactory.java
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AzureServicebusComponentBuilderFactory.java
index e14697d1ddd0..9d0610545128 100644
---
a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AzureServicebusComponentBuilderFactory.java
+++
b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/AzureServicebusComponentBuilderFactory.java
@@ -514,7 +514,11 @@ public interface AzureServicebusComponentBuilderFactory {
/**
* Sets the connection string for a Service Bus namespace or a specific
- * Service Bus resource.
+ * Service Bus resource. Connection strings commonly contain characters
+ * with a special meaning in URIs (the SharedAccessKey is a Base64
value
+ * that may contain plus, slash or equals characters): when configuring
+ * the connection string directly in an endpoint URI, wrap the value
+ * with RAW() so it is not URI-decoded.
*
* The option is a: <code>java.lang.String</code> type.
*
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ServiceBusEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ServiceBusEndpointBuilderFactory.java
index e25c92fc3540..224041c80d48 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ServiceBusEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ServiceBusEndpointBuilderFactory.java
@@ -524,7 +524,11 @@ public interface ServiceBusEndpointBuilderFactory {
}
/**
* Sets the connection string for a Service Bus namespace or a specific
- * Service Bus resource.
+ * Service Bus resource. Connection strings commonly contain characters
+ * with a special meaning in URIs (the SharedAccessKey is a Base64
value
+ * that may contain plus, slash or equals characters): when configuring
+ * the connection string directly in an endpoint URI, wrap the value
+ * with RAW() so it is not URI-decoded.
*
* The option is a: <code>java.lang.String</code> type.
*
@@ -1128,7 +1132,11 @@ public interface ServiceBusEndpointBuilderFactory {
}
/**
* Sets the connection string for a Service Bus namespace or a specific
- * Service Bus resource.
+ * Service Bus resource. Connection strings commonly contain characters
+ * with a special meaning in URIs (the SharedAccessKey is a Base64
value
+ * that may contain plus, slash or equals characters): when configuring
+ * the connection string directly in an endpoint URI, wrap the value
+ * with RAW() so it is not URI-decoded.
*
* The option is a: <code>java.lang.String</code> type.
*
@@ -1488,7 +1496,11 @@ public interface ServiceBusEndpointBuilderFactory {
}
/**
* Sets the connection string for a Service Bus namespace or a specific
- * Service Bus resource.
+ * Service Bus resource. Connection strings commonly contain characters
+ * with a special meaning in URIs (the SharedAccessKey is a Base64
value
+ * that may contain plus, slash or equals characters): when configuring
+ * the connection string directly in an endpoint URI, wrap the value
+ * with RAW() so it is not URI-decoded.
*
* The option is a: <code>java.lang.String</code> type.
*