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 aaf0369de0ee CAMEL-25875: camel-milo - a sessionTimeout configured on
the component reaches its endpoints (#28252)
aaf0369de0ee is described below
commit aaf0369de0eeb2785f02353785f2c99f31dd1c1b
Author: Serdar Gökay <[email protected]>
AuthorDate: Thu Oct 22 23:48:37 2026 +0300
CAMEL-25875: camel-milo - a sessionTimeout configured on the component
reaches its endpoints (#28252)
Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
.../milo/client/MiloClientConfiguration.java | 1 +
.../milo/SessionTimeoutConfigurationTest.java | 58 ++++++++++++++++++++++
.../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 6 +++
3 files changed, 65 insertions(+)
diff --git
a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
index 405bd529cb8b..4d6914000b89 100644
---
a/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
+++
b/components/camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientConfiguration.java
@@ -144,6 +144,7 @@ public class MiloClientConfiguration implements Cloneable {
this.applicationUri = other.applicationUri;
this.productUri = other.productUri;
this.requestTimeout = other.requestTimeout;
+ this.sessionTimeout = other.sessionTimeout;
this.reconnectTimeout = other.reconnectTimeout;
this.channelLifetime = other.channelLifetime;
this.sessionName = other.sessionName;
diff --git
a/components/camel-milo/src/test/java/org/apache/camel/component/milo/SessionTimeoutConfigurationTest.java
b/components/camel-milo/src/test/java/org/apache/camel/component/milo/SessionTimeoutConfigurationTest.java
new file mode 100644
index 000000000000..8f2b79b35a7d
--- /dev/null
+++
b/components/camel-milo/src/test/java/org/apache/camel/component/milo/SessionTimeoutConfigurationTest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.apache.camel.component.milo;
+
+import org.apache.camel.component.milo.browse.MiloBrowseComponent;
+import org.apache.camel.component.milo.browse.MiloBrowseEndpoint;
+import org.apache.camel.component.milo.client.MiloClientComponent;
+import org.apache.camel.component.milo.client.MiloClientEndpoint;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * A session timeout configured on the component reaches its endpoints.
+ */
+public class SessionTimeoutConfigurationTest extends CamelTestSupport {
+
+ private static final String SERVER = "opc.tcp://localhost:4840";
+
+ @Test
+ void clientComponentSetsTheDefaultSessionTimeoutOfItsEndpoints() {
+ context.getComponent("milo-client",
MiloClientComponent.class).getConfiguration().setSessionTimeout(30_000L);
+
+ assertEquals(30_000L,
+ context.getEndpoint("milo-client:" + SERVER,
MiloClientEndpoint.class).getConfiguration()
+ .getSessionTimeout());
+ assertEquals(45_000L,
+ context.getEndpoint("milo-client:" + SERVER +
"?sessionTimeout=45000", MiloClientEndpoint.class)
+ .getConfiguration().getSessionTimeout());
+ }
+
+ @Test
+ void browseComponentSetsTheDefaultSessionTimeoutOfItsEndpoints() {
+ context.getComponent("milo-browse",
MiloBrowseComponent.class).getConfiguration().setSessionTimeout(30_000L);
+
+ assertEquals(30_000L,
+ context.getEndpoint("milo-browse:" + SERVER,
MiloBrowseEndpoint.class).getConfiguration()
+ .getSessionTimeout());
+ assertEquals(45_000L,
+ context.getEndpoint("milo-browse:" + SERVER +
"?sessionTimeout=45000", MiloBrowseEndpoint.class)
+ .getConfiguration().getSessionTimeout());
+ }
+}
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index a47df8613e64..58d674bd440e 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -2295,6 +2295,12 @@ and the delay between two connection attempts stayed 10
seconds. It now sets tha
delay, and a value of 0 or less is rejected. To set the request timeout, use
the `requestTimeout` option instead
(for example `camel.component.milo-client.requestTimeout`, or
`getConfiguration().setRequestTimeout(...)` in Java).
+=== camel-milo - the sessionTimeout of the components reaches their endpoints
+
+A `sessionTimeout` configured on the `milo-client` or `milo-browse` component
(for example
+`camel.component.milo-client.sessionTimeout`) did not reach its endpoints, so
their sessions used the default of Milo,
+120000 milliseconds. The endpoints now use it, unless they set
`sessionTimeout` themselves.
+
=== camel-infinispan - the key option of the producer takes precedence over
the key header
The `infinispan` and `infinispan-embedded` producers now use the `key` option
of the endpoint when it is set, and use the