This is an automated email from the ASF dual-hosted git repository.
davsclaus 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 f3e80ed083a2 camel-thrift: clientTimeout is labelled and described
consumer-only, but the producer sets its socket timeout with it (#29988)
f3e80ed083a2 is described below
commit f3e80ed083a22161d53c80d99f84530e8ca99bbe
Author: dhairya05 <[email protected]>
AuthorDate: Sun Nov 15 20:03:55 2026 +0530
camel-thrift: clientTimeout is labelled and described consumer-only, but
the producer sets its socket timeout with it (#29988)
* camel-thrift: clientTimeout is labelled and described consumer-only, but
the producer sets its socket timeout with it
The producer passes the option as the timeout of the socket it connects
with:
syncTransport =
TSSLTransportFactory.getClientSocket(configuration.getHost(),
configuration.getPort(),
configuration.getClientTimeout(), sslParams);
which is the reading the name invites, since on a producer the component
is the client. The consumer uses the same value as the server socket's
SO_TIMEOUT.
The option is labelled consumer and documented as "Client timeout for
consumers", so a producer over TLS has no documented way to set its
connect timeout, and the one option that does it is filed under the
other side.
Label it common and describe both directions.
* camel-thrift: split the clientTimeout description into shorter sentences
Review feedback: the second sentence ran past the 25-word guidance.
* Regen
* camel-thrift: describe what clientTimeout actually does on each side
The previous wording claimed the consumer sets the timeout of the server
socket waiting for a client and the producer a connect timeout. Neither
is what libthrift does with the value:
- Producer: only initializeSslTransport passes it on, via
TSSLTransportFactory.getClientSocket. The plain transports,
new TSocket(host, port) and new TNonblockingSocket(host, port), never
see it. And createClient connects the socket first and then calls
setSoTimeout(timeout), so it is a read timeout.
- Consumer: TServerSocket.listen() puts the server socket back to
setSoTimeout(0), and accept() applies clientTimeout to each accepted
client connection.
So on both sides it is SO_TIMEOUT on a client connection, and on the
producer only when negotiationType is SSL.
Co-Authored-By: Claude Opus 5 <[email protected]>
* Regen
---------
Co-authored-by: Guillaume Nodet <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
---
.../apache/camel/catalog/components/thrift.json | 6 +-
.../org/apache/camel/component/thrift/thrift.json | 6 +-
.../component/thrift/ThriftConfiguration.java | 5 +-
.../endpoint/dsl/ThriftEndpointBuilderFactory.java | 124 ++++++++++++++++-----
4 files changed, 105 insertions(+), 36 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/thrift.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/thrift.json
index 079153362a10..a0728d2997b4 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/thrift.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/thrift.json
@@ -42,9 +42,9 @@
"host": { "index": 0, "kind": "path", "displayName": "Host", "group":
"common", "label": "", "required": true, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.thrift.ThriftConfiguration",
"configurationField": "configuration", "description": "The Thrift server host
name. This is localhost or 0.0.0.0 (if not defined) when being a consumer or
remote server host name when using [...]
"port": { "index": 1, "kind": "path", "displayName": "Port", "group":
"common", "label": "", "required": true, "type": "integer", "javaType": "int",
"deprecated": false, "autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "The Thrift server port" },
"service": { "index": 2, "kind": "path", "displayName": "Service",
"group": "common", "label": "", "required": true, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.thrift.ThriftConfiguration",
"configurationField": "configuration", "description": "Fully qualified service
name from the thrift descriptor file (package dot service definition name)" },
- "compressionType": { "index": 3, "kind": "parameter", "displayName":
"Compression Type", "group": "common", "label": "", "required": false, "type":
"enum", "javaType": "org.apache.camel.component.thrift.ThriftCompressionType",
"enum": [ "NONE", "ZLIB" ], "deprecated": false, "autowired": false, "secret":
false, "defaultValue": "NONE", "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "Protocol compress [...]
- "exchangeProtocol": { "index": 4, "kind": "parameter", "displayName":
"Exchange Protocol", "group": "common", "label": "", "required": false, "type":
"enum", "javaType": "org.apache.camel.component.thrift.ThriftExchangeProtocol",
"enum": [ "BINARY", "JSON", "SJSON", "COMPACT" ], "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "BINARY",
"configurationClass": "org.apache.camel.component.thrift.ThriftConfiguration",
"configurationField": "configuration", "descr [...]
- "clientTimeout": { "index": 5, "kind": "parameter", "displayName": "Client
Timeout", "group": "consumer", "label": "consumer", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "Client timeout for consumers" },
+ "clientTimeout": { "index": 3, "kind": "parameter", "displayName": "Client
Timeout", "group": "common", "label": "common", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "Socket timeout (SO_TIMEOUT) in milliseconds.
On a consumer it applies to the connections accepted from clients. On a [...]
+ "compressionType": { "index": 4, "kind": "parameter", "displayName":
"Compression Type", "group": "common", "label": "", "required": false, "type":
"enum", "javaType": "org.apache.camel.component.thrift.ThriftCompressionType",
"enum": [ "NONE", "ZLIB" ], "deprecated": false, "autowired": false, "secret":
false, "defaultValue": "NONE", "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "Protocol compress [...]
+ "exchangeProtocol": { "index": 5, "kind": "parameter", "displayName":
"Exchange Protocol", "group": "common", "label": "", "required": false, "type":
"enum", "javaType": "org.apache.camel.component.thrift.ThriftExchangeProtocol",
"enum": [ "BINARY", "JSON", "SJSON", "COMPACT" ], "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "BINARY",
"configurationClass": "org.apache.camel.component.thrift.ThriftConfiguration",
"configurationField": "configuration", "descr [...]
"maxPoolSize": { "index": 6, "kind": "parameter", "displayName": "Max Pool
Size", "group": "consumer", "label": "consumer", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 10, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "The Thrift server consumer max thread pool
size" },
"muteException": { "index": 7, "kind": "parameter", "displayName": "Mute
Exception", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": true, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "If enabled and an Exchange failed processing
on the consumer side, the Thrift client r [...]
"poolSize": { "index": 8, "kind": "parameter", "displayName": "Pool Size",
"group": "consumer", "label": "consumer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": 1, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "The Thrift server consumer initial thread pool
size" },
diff --git
a/components/camel-thrift/src/generated/resources/META-INF/org/apache/camel/component/thrift/thrift.json
b/components/camel-thrift/src/generated/resources/META-INF/org/apache/camel/component/thrift/thrift.json
index 079153362a10..a0728d2997b4 100644
---
a/components/camel-thrift/src/generated/resources/META-INF/org/apache/camel/component/thrift/thrift.json
+++
b/components/camel-thrift/src/generated/resources/META-INF/org/apache/camel/component/thrift/thrift.json
@@ -42,9 +42,9 @@
"host": { "index": 0, "kind": "path", "displayName": "Host", "group":
"common", "label": "", "required": true, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.thrift.ThriftConfiguration",
"configurationField": "configuration", "description": "The Thrift server host
name. This is localhost or 0.0.0.0 (if not defined) when being a consumer or
remote server host name when using [...]
"port": { "index": 1, "kind": "path", "displayName": "Port", "group":
"common", "label": "", "required": true, "type": "integer", "javaType": "int",
"deprecated": false, "autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "The Thrift server port" },
"service": { "index": 2, "kind": "path", "displayName": "Service",
"group": "common", "label": "", "required": true, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.thrift.ThriftConfiguration",
"configurationField": "configuration", "description": "Fully qualified service
name from the thrift descriptor file (package dot service definition name)" },
- "compressionType": { "index": 3, "kind": "parameter", "displayName":
"Compression Type", "group": "common", "label": "", "required": false, "type":
"enum", "javaType": "org.apache.camel.component.thrift.ThriftCompressionType",
"enum": [ "NONE", "ZLIB" ], "deprecated": false, "autowired": false, "secret":
false, "defaultValue": "NONE", "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "Protocol compress [...]
- "exchangeProtocol": { "index": 4, "kind": "parameter", "displayName":
"Exchange Protocol", "group": "common", "label": "", "required": false, "type":
"enum", "javaType": "org.apache.camel.component.thrift.ThriftExchangeProtocol",
"enum": [ "BINARY", "JSON", "SJSON", "COMPACT" ], "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "BINARY",
"configurationClass": "org.apache.camel.component.thrift.ThriftConfiguration",
"configurationField": "configuration", "descr [...]
- "clientTimeout": { "index": 5, "kind": "parameter", "displayName": "Client
Timeout", "group": "consumer", "label": "consumer", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "Client timeout for consumers" },
+ "clientTimeout": { "index": 3, "kind": "parameter", "displayName": "Client
Timeout", "group": "common", "label": "common", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "Socket timeout (SO_TIMEOUT) in milliseconds.
On a consumer it applies to the connections accepted from clients. On a [...]
+ "compressionType": { "index": 4, "kind": "parameter", "displayName":
"Compression Type", "group": "common", "label": "", "required": false, "type":
"enum", "javaType": "org.apache.camel.component.thrift.ThriftCompressionType",
"enum": [ "NONE", "ZLIB" ], "deprecated": false, "autowired": false, "secret":
false, "defaultValue": "NONE", "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "Protocol compress [...]
+ "exchangeProtocol": { "index": 5, "kind": "parameter", "displayName":
"Exchange Protocol", "group": "common", "label": "", "required": false, "type":
"enum", "javaType": "org.apache.camel.component.thrift.ThriftExchangeProtocol",
"enum": [ "BINARY", "JSON", "SJSON", "COMPACT" ], "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "BINARY",
"configurationClass": "org.apache.camel.component.thrift.ThriftConfiguration",
"configurationField": "configuration", "descr [...]
"maxPoolSize": { "index": 6, "kind": "parameter", "displayName": "Max Pool
Size", "group": "consumer", "label": "consumer", "required": false, "type":
"integer", "javaType": "int", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": 10, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "The Thrift server consumer max thread pool
size" },
"muteException": { "index": 7, "kind": "parameter", "displayName": "Mute
Exception", "group": "consumer", "label": "consumer", "required": false,
"type": "boolean", "javaType": "boolean", "deprecated": false, "autowired":
false, "secret": false, "defaultValue": true, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "If enabled and an Exchange failed processing
on the consumer side, the Thrift client r [...]
"poolSize": { "index": 8, "kind": "parameter", "displayName": "Pool Size",
"group": "consumer", "label": "consumer", "required": false, "type": "integer",
"javaType": "int", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": 1, "configurationClass":
"org.apache.camel.component.thrift.ThriftConfiguration", "configurationField":
"configuration", "description": "The Thrift server consumer initial thread pool
size" },
diff --git
a/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/ThriftConfiguration.java
b/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/ThriftConfiguration.java
index 470b193b040b..246985df3543 100644
---
a/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/ThriftConfiguration.java
+++
b/components/camel-thrift/src/main/java/org/apache/camel/component/thrift/ThriftConfiguration.java
@@ -54,7 +54,7 @@ public class ThriftConfiguration {
@UriParam(defaultValue = "NONE")
private ThriftCompressionType compressionType = ThriftCompressionType.NONE;
- @UriParam(label = "consumer")
+ @UriParam(label = "common")
private int clientTimeout;
@UriParam(label = "consumer", defaultValue = "" +
ThriftConstants.THRIFT_CONSUMER_POOL_SIZE)
@@ -156,7 +156,8 @@ public class ThriftConfiguration {
}
/**
- * Client timeout for consumers
+ * Socket timeout (SO_TIMEOUT) in milliseconds. On a consumer it applies
to the connections accepted from clients.
+ * On a producer it is only used when negotiationType is SSL.
*/
public int getClientTimeout() {
return clientTimeout;
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ThriftEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ThriftEndpointBuilderFactory.java
index b2ecdaff9c57..226fe5baeb19 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ThriftEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ThriftEndpointBuilderFactory.java
@@ -44,6 +44,38 @@ public interface ThriftEndpointBuilderFactory {
default AdvancedThriftEndpointConsumerBuilder advanced() {
return (AdvancedThriftEndpointConsumerBuilder) this;
}
+ /**
+ * Socket timeout (SO_TIMEOUT) in milliseconds. On a consumer it
applies
+ * to the connections accepted from clients. On a producer it is only
+ * used when negotiationType is SSL.
+ *
+ * The option is a: <code>int</code> type.
+ *
+ * Group: common
+ *
+ * @param clientTimeout the value to set
+ * @return the dsl builder
+ */
+ default ThriftEndpointConsumerBuilder clientTimeout(int clientTimeout)
{
+ doSetProperty("clientTimeout", clientTimeout);
+ return this;
+ }
+ /**
+ * Socket timeout (SO_TIMEOUT) in milliseconds. On a consumer it
applies
+ * to the connections accepted from clients. On a producer it is only
+ * used when negotiationType is SSL.
+ *
+ * The option will be converted to a <code>int</code> type.
+ *
+ * Group: common
+ *
+ * @param clientTimeout the value to set
+ * @return the dsl builder
+ */
+ default ThriftEndpointConsumerBuilder clientTimeout(String
clientTimeout) {
+ doSetProperty("clientTimeout", clientTimeout);
+ return this;
+ }
/**
* Protocol compression mechanism type.
*
@@ -112,34 +144,6 @@ public interface ThriftEndpointBuilderFactory {
doSetProperty("exchangeProtocol", exchangeProtocol);
return this;
}
- /**
- * Client timeout for consumers.
- *
- * The option is a: <code>int</code> type.
- *
- * Group: consumer
- *
- * @param clientTimeout the value to set
- * @return the dsl builder
- */
- default ThriftEndpointConsumerBuilder clientTimeout(int clientTimeout)
{
- doSetProperty("clientTimeout", clientTimeout);
- return this;
- }
- /**
- * Client timeout for consumers.
- *
- * The option will be converted to a <code>int</code> type.
- *
- * Group: consumer
- *
- * @param clientTimeout the value to set
- * @return the dsl builder
- */
- default ThriftEndpointConsumerBuilder clientTimeout(String
clientTimeout) {
- doSetProperty("clientTimeout", clientTimeout);
- return this;
- }
/**
* The Thrift server consumer max thread pool size.
*
@@ -470,6 +474,38 @@ public interface ThriftEndpointBuilderFactory {
return (AdvancedThriftEndpointProducerBuilder) this;
}
+ /**
+ * Socket timeout (SO_TIMEOUT) in milliseconds. On a consumer it
applies
+ * to the connections accepted from clients. On a producer it is only
+ * used when negotiationType is SSL.
+ *
+ * The option is a: <code>int</code> type.
+ *
+ * Group: common
+ *
+ * @param clientTimeout the value to set
+ * @return the dsl builder
+ */
+ default ThriftEndpointProducerBuilder clientTimeout(int clientTimeout)
{
+ doSetProperty("clientTimeout", clientTimeout);
+ return this;
+ }
+ /**
+ * Socket timeout (SO_TIMEOUT) in milliseconds. On a consumer it
applies
+ * to the connections accepted from clients. On a producer it is only
+ * used when negotiationType is SSL.
+ *
+ * The option will be converted to a <code>int</code> type.
+ *
+ * Group: common
+ *
+ * @param clientTimeout the value to set
+ * @return the dsl builder
+ */
+ default ThriftEndpointProducerBuilder clientTimeout(String
clientTimeout) {
+ doSetProperty("clientTimeout", clientTimeout);
+ return this;
+ }
/**
* Protocol compression mechanism type.
*
@@ -715,6 +751,38 @@ public interface ThriftEndpointBuilderFactory {
return (AdvancedThriftEndpointBuilder) this;
}
+ /**
+ * Socket timeout (SO_TIMEOUT) in milliseconds. On a consumer it
applies
+ * to the connections accepted from clients. On a producer it is only
+ * used when negotiationType is SSL.
+ *
+ * The option is a: <code>int</code> type.
+ *
+ * Group: common
+ *
+ * @param clientTimeout the value to set
+ * @return the dsl builder
+ */
+ default ThriftEndpointBuilder clientTimeout(int clientTimeout) {
+ doSetProperty("clientTimeout", clientTimeout);
+ return this;
+ }
+ /**
+ * Socket timeout (SO_TIMEOUT) in milliseconds. On a consumer it
applies
+ * to the connections accepted from clients. On a producer it is only
+ * used when negotiationType is SSL.
+ *
+ * The option will be converted to a <code>int</code> type.
+ *
+ * Group: common
+ *
+ * @param clientTimeout the value to set
+ * @return the dsl builder
+ */
+ default ThriftEndpointBuilder clientTimeout(String clientTimeout) {
+ doSetProperty("clientTimeout", clientTimeout);
+ return this;
+ }
/**
* Protocol compression mechanism type.
*