From 26c9abb69277eb3721fc681b8fdc7044f39f488a Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Mon, 24 Feb 2025 12:26:26 +0200 Subject: [PATCH 01/10] Document Kubernetes Kit backend session expiration policy See: https://github.com/vaadin/kubernetes-kit/pull/163/files --- articles/tools/kubernetes/configuration.adoc | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index 6a69fd9a86..64653eb98e 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -84,3 +84,24 @@ spring: host: redis-service ---- -- + +== Backend Session Expiration Policy + +Backend session expiration policy allows to define an expiration timeout for the backend stored session. By default no expiration is set, but can be expiration can be activated setting the property or by providing a custom SessionExpirationPolicy bean. If no unit is provided in the property, seconds are assumed. + +[.example] +-- +.application.properties +[source,properties] +---- +vaadin.kubernetes.backend-session-expiration-tolerance: duration +---- + +.application.yaml +[source,yaml] +---- +vaadin: + kubernetes: + backend-session-expiration-tolerance: duration +---- +-- From fba624226f8ef1e8c77e7ac13e092e5cdf86d87d Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Mon, 24 Feb 2025 12:46:38 +0200 Subject: [PATCH 02/10] Update articles/tools/kubernetes/configuration.adoc Co-authored-by: Matthew Wilson <98319962+MatthewVaadin@users.noreply.github.com> --- articles/tools/kubernetes/configuration.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index 64653eb98e..6b7648f3b6 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -87,7 +87,7 @@ spring: == Backend Session Expiration Policy -Backend session expiration policy allows to define an expiration timeout for the backend stored session. By default no expiration is set, but can be expiration can be activated setting the property or by providing a custom SessionExpirationPolicy bean. If no unit is provided in the property, seconds are assumed. +The backend session expiration policy allows you to define an expiration timeout for the backend stored session. By default no expiration is set, but expiration can be activated by setting the property or by providing a custom `SessionExpirationPolicy` bean. If no unit is provided in the property, seconds are assumed. [.example] -- From 0101c6e2d19d61781d77282b8388bb832a1b8d6e Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Mon, 24 Feb 2025 13:05:07 +0200 Subject: [PATCH 03/10] Update configuration.adoc --- articles/tools/kubernetes/configuration.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index 6b7648f3b6..ff8853bcb6 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -87,7 +87,7 @@ spring: == Backend Session Expiration Policy -The backend session expiration policy allows you to define an expiration timeout for the backend stored session. By default no expiration is set, but expiration can be activated by setting the property or by providing a custom `SessionExpirationPolicy` bean. If no unit is provided in the property, seconds are assumed. +The backend session expiration policy allows you to define an expiration timeout for the backend stored session. By default no expiration is set, but expiration can be activated by setting the property or by providing a custom `SessionExpirationPolicy` bean. The property defines the amount of time to be added to the HTTP session timeout to determine the expiration of the backend session. If time unit is not given, milliseconds is assumed. [.example] -- From fce35693c0c330260e081043eed0998d49e0ca6c Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Mon, 24 Feb 2025 13:27:41 +0200 Subject: [PATCH 04/10] add Java example --- articles/tools/kubernetes/configuration.adoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index ff8853bcb6..4ee64d7606 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -104,4 +104,13 @@ vaadin: kubernetes: backend-session-expiration-tolerance: duration ---- + +.Java +[source,java] +---- +@Bean +SessionExpirationPolicy sessionExpirationPolicy() { + return sessionTimeout -> Duration.ofMinutes(60); +} +---- -- From 7e750fc3ae84f5a2addbe7d8748f8fe90edda741 Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Mon, 24 Feb 2025 15:00:37 +0200 Subject: [PATCH 05/10] Update articles/tools/kubernetes/configuration.adoc Co-authored-by: Marco Collovati --- articles/tools/kubernetes/configuration.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index 4ee64d7606..b80b111a99 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -87,7 +87,7 @@ spring: == Backend Session Expiration Policy -The backend session expiration policy allows you to define an expiration timeout for the backend stored session. By default no expiration is set, but expiration can be activated by setting the property or by providing a custom `SessionExpirationPolicy` bean. The property defines the amount of time to be added to the HTTP session timeout to determine the expiration of the backend session. If time unit is not given, milliseconds is assumed. +The backend session expiration policy allows you to define an expiration timeout for the backend stored session. By default no expiration is set, but expiration can be activated by setting the `vaadin.kubernetes.backend-session-expiration-tolerance` property or by providing a custom `SessionExpirationPolicy` bean. The property defines the amount of time to be added to the HTTP session timeout to determine the expiration of the backend session. If time unit is not given, milliseconds is assumed. [.example] -- From c1af842fa2c47ddff5c15c1ca158476b95e8fc30 Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Mon, 24 Feb 2025 15:01:38 +0200 Subject: [PATCH 06/10] Update articles/tools/kubernetes/configuration.adoc Co-authored-by: Marco Collovati --- articles/tools/kubernetes/configuration.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index b80b111a99..e2c1261cfe 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -94,7 +94,8 @@ The backend session expiration policy allows you to define an expiration timeout .application.properties [source,properties] ---- -vaadin.kubernetes.backend-session-expiration-tolerance: duration +# Given an HTTP session timeout of 30 minuts, the session stored in the backed will expire 35 minutes of inactivity +vaadin.kubernetes.backend-session-expiration-tolerance: 5m ---- .application.yaml From 30c44de787b0c92aaa2179821ecc566d1a094928 Mon Sep 17 00:00:00 2001 From: russelljtdyer <6652767+russelljtdyer@users.noreply.github.com> Date: Fri, 28 Feb 2025 11:51:05 +0100 Subject: [PATCH 07/10] Edited new text only. --- articles/tools/kubernetes/configuration.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index e2c1261cfe..86160165a5 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -87,14 +87,14 @@ spring: == Backend Session Expiration Policy -The backend session expiration policy allows you to define an expiration timeout for the backend stored session. By default no expiration is set, but expiration can be activated by setting the `vaadin.kubernetes.backend-session-expiration-tolerance` property or by providing a custom `SessionExpirationPolicy` bean. The property defines the amount of time to be added to the HTTP session timeout to determine the expiration of the backend session. If time unit is not given, milliseconds is assumed. +The backend session expiration policy allows you to define an expiration timeout for the backend stored session. By default, no expiration is set. However, expiration can be activated by setting the `vaadin.kubernetes.backend-session-expiration-tolerance` property, or by providing a custom `SessionExpirationPolicy` bean. The property defines the amount of time to be added to the HTTP session timeout to determine the expiration of the backend session. If a time unit is not given, milliseconds is assumed. [.example] -- .application.properties [source,properties] ---- -# Given an HTTP session timeout of 30 minuts, the session stored in the backed will expire 35 minutes of inactivity +# Given an HTTP session timeout of 30 minutes, the session stored in the backed will expire after 35 minutes of inactivity vaadin.kubernetes.backend-session-expiration-tolerance: 5m ---- From a100852dc54e1903cd4abf0d5b3214470184b1e4 Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Mon, 10 Mar 2025 14:50:16 +0200 Subject: [PATCH 08/10] Update articles/tools/kubernetes/configuration.adoc Co-authored-by: Marco Collovati --- articles/tools/kubernetes/configuration.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index 86160165a5..5c4912a94e 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -103,7 +103,7 @@ vaadin.kubernetes.backend-session-expiration-tolerance: 5m ---- vaadin: kubernetes: - backend-session-expiration-tolerance: duration + backend-session-expiration-tolerance: 5m ---- .Java From e18726c3e8ec8161ce30edca3e7c412cf29ccf4a Mon Sep 17 00:00:00 2001 From: Marco Collovati Date: Wed, 7 May 2025 15:24:48 +0200 Subject: [PATCH 09/10] Apply suggestions from code review Co-authored-by: Jorg Heymans --- articles/tools/kubernetes/configuration.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index 5c4912a94e..bea5086b17 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -94,7 +94,7 @@ The backend session expiration policy allows you to define an expiration timeout .application.properties [source,properties] ---- -# Given an HTTP session timeout of 30 minutes, the session stored in the backed will expire after 35 minutes of inactivity +# Given an HTTP session timeout of 30 minutes, the session stored in the backend will expire after 35 minutes of inactivity vaadin.kubernetes.backend-session-expiration-tolerance: 5m ---- From 119781c9607aa00d9a698b1452b2260cf718522a Mon Sep 17 00:00:00 2001 From: Matthew Wilson Date: Thu, 8 May 2025 11:39:39 +0300 Subject: [PATCH 10/10] Apply suggestions for example format and clarify differences --- articles/tools/kubernetes/configuration.adoc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/articles/tools/kubernetes/configuration.adoc b/articles/tools/kubernetes/configuration.adoc index bea5086b17..79092b7dbc 100644 --- a/articles/tools/kubernetes/configuration.adoc +++ b/articles/tools/kubernetes/configuration.adoc @@ -87,31 +87,33 @@ spring: == Backend Session Expiration Policy -The backend session expiration policy allows you to define an expiration timeout for the backend stored session. By default, no expiration is set. However, expiration can be activated by setting the `vaadin.kubernetes.backend-session-expiration-tolerance` property, or by providing a custom `SessionExpirationPolicy` bean. The property defines the amount of time to be added to the HTTP session timeout to determine the expiration of the backend session. If a time unit is not given, milliseconds is assumed. +The backend session expiration policy allows you to define an expiration timeout for the backend stored session. By default, no expiration is set. However, expiration can be activated by setting the `vaadin.kubernetes.backend-session-expiration-tolerance` property. The property defines the amount of time to be added to the HTTP session timeout to determine the expiration of the backend session. If a time unit is not given, milliseconds is assumed. Another option is to provide a custom `SessionExpirationPolicy` bean, which allows you to define a custom expiration timeout, independent of the HTTP session timeout value. [.example] -- -.application.properties +Given an HTTP session timeout of 30 minutes, the session stored in the backend will expire after 35 minutes of inactivity. [source,properties] ---- -# Given an HTTP session timeout of 30 minutes, the session stored in the backend will expire after 35 minutes of inactivity + vaadin.kubernetes.backend-session-expiration-tolerance: 5m ---- -.application.yaml +Given an HTTP session timeout of 30 minutes, the session stored in the backend will expire after 35 minutes of inactivity. [source,yaml] ---- + vaadin: kubernetes: backend-session-expiration-tolerance: 5m ---- -.Java +The session stored in the backend will expire after 35 minutes of inactivity, regardless of the HTTP session timeout. [source,java] ---- + @Bean SessionExpirationPolicy sessionExpirationPolicy() { - return sessionTimeout -> Duration.ofMinutes(60); + return sessionTimeout -> Duration.ofMinutes(35); } ---- --