From 201eb1aead87d01df4346b6666e5610740697a76 Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Wed, 1 May 2024 09:43:36 +0200 Subject: [PATCH 01/22] [SDCISA-15833] HINT: issue nbr From db5da77b373fa75641aefa7627cf3b962e7b2ea1 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 2 May 2024 13:03:06 +0000 Subject: [PATCH 02/22] updating poms for 2.1.5 branch with snapshot versions From c3b3ebbb331b539902052612c578e2a727f941c1 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 2 May 2024 13:03:08 +0000 Subject: [PATCH 03/22] updating poms for 2.1.6-SNAPSHOT development --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 9a322872..13763dd8 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index 3c96630f..7afe50a7 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index ed566492..c9d18b27 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index c18f85b1..a2b58575 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index 9c28e553..fe871810 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 74aeebd7..00d652e9 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index c7ffb8b8..c59c50e3 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index cc5d5134..5b4c8d30 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index 52a6b8fe..b483b33c 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 0ed18963..74e18cfa 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index 93721503..bb756634 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 4f04e7d5..99969817 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index da414dbf..39f112da 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index c0d30813..955d6ffb 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index 0b4d8f8a..d7c3852a 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 21d95520..73428d8c 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index 07d13403..4df6aa68 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index 8c7c3490..02cb90c5 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index dfa07db2..90c22167 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index 30e121d0..a87659fb 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 4beb9415..3ec3d435 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index a10c670c..db93a74a 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index 69b9e5c2..323c7d57 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index 1a494434..c962dbc2 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT gateleen-validation diff --git a/pom.xml b/pom.xml index c4da97af..ae4e3e3e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.6-SNAPSHOT pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From 63838635aa41b417702d38fda32ada61e6182063 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 2 May 2024 13:03:10 +0000 Subject: [PATCH 04/22] updating poms for branch'release-2.1.5' with non-snapshot versions --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 9a322872..54d64f88 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index 3c96630f..79365ca6 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index ed566492..810cf3da 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index c18f85b1..3f472dfc 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index 9c28e553..2046de0d 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 74aeebd7..a80bffe0 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index c7ffb8b8..a043180f 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index cc5d5134..cd4fd4ff 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index 52a6b8fe..c52a07a8 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 0ed18963..9bc8c5b7 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index 93721503..70203d1c 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 4f04e7d5..6fdf0787 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index da414dbf..82448480 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index c0d30813..788ddbfa 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index 0b4d8f8a..e1557455 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 21d95520..2fbdcd80 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index 07d13403..8ff70371 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index 8c7c3490..3ea1aac8 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index dfa07db2..50b0f372 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index 30e121d0..3a5ec567 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 4beb9415..f3f77596 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index a10c670c..5869c922 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index 69b9e5c2..5a62a67e 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index 1a494434..72e6d885 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 gateleen-validation diff --git a/pom.xml b/pom.xml index c4da97af..c69a9392 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5-SNAPSHOT + 2.1.5 pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From 38e2d3f4d5f48593eb86e001c71e31fd451e2ed3 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 2 May 2024 13:07:30 +0000 Subject: [PATCH 05/22] updating develop poms to master versions to avoid merge conflicts --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 13763dd8..54d64f88 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index 7afe50a7..79365ca6 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index c9d18b27..810cf3da 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index a2b58575..3f472dfc 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index fe871810..2046de0d 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 00d652e9..a80bffe0 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index c59c50e3..a043180f 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index 5b4c8d30..cd4fd4ff 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index b483b33c..c52a07a8 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 74e18cfa..9bc8c5b7 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index bb756634..70203d1c 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 99969817..6fdf0787 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index 39f112da..82448480 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index 955d6ffb..788ddbfa 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index d7c3852a..e1557455 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 73428d8c..2fbdcd80 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index 4df6aa68..8ff70371 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index 02cb90c5..3ea1aac8 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index 90c22167..50b0f372 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index a87659fb..3a5ec567 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 3ec3d435..f3f77596 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index db93a74a..5869c922 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index 323c7d57..5a62a67e 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index c962dbc2..72e6d885 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 gateleen-validation diff --git a/pom.xml b/pom.xml index ae4e3e3e..c69a9392 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.5 pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From 6df8d59a813c142f2ab5705e65cc70909cd156ea Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 2 May 2024 13:07:33 +0000 Subject: [PATCH 06/22] Updating develop poms back to pre merge state --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 54d64f88..13763dd8 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index 79365ca6..7afe50a7 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index 810cf3da..c9d18b27 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index 3f472dfc..a2b58575 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index 2046de0d..fe871810 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index a80bffe0..00d652e9 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index a043180f..c59c50e3 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index cd4fd4ff..5b4c8d30 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index c52a07a8..b483b33c 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 9bc8c5b7..74e18cfa 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index 70203d1c..bb756634 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 6fdf0787..99969817 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index 82448480..39f112da 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index 788ddbfa..955d6ffb 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index e1557455..d7c3852a 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 2fbdcd80..73428d8c 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index 8ff70371..4df6aa68 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index 3ea1aac8..02cb90c5 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index 50b0f372..90c22167 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index 3a5ec567..a87659fb 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index f3f77596..3ec3d435 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index 5869c922..db93a74a 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index 5a62a67e..323c7d57 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index 72e6d885..c962dbc2 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT gateleen-validation diff --git a/pom.xml b/pom.xml index c69a9392..ae4e3e3e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.5 + 2.1.6-SNAPSHOT pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From 677cc43071a044f464b08f40486e03f32dda4971 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 2 May 2024 15:01:53 +0000 Subject: [PATCH 07/22] updating poms for 2.1.6 branch with snapshot versions From 150a997681e5c563a132920b41e98de46b825d43 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 2 May 2024 15:01:55 +0000 Subject: [PATCH 08/22] updating poms for 2.1.7-SNAPSHOT development --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 13763dd8..c4563981 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index 7afe50a7..c6124598 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index c9d18b27..3374b224 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index a2b58575..1fecc47b 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index fe871810..cd4fa1dd 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 00d652e9..59455301 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index c59c50e3..d0c5e3ca 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index 5b4c8d30..c58d33a0 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index b483b33c..8a6ba5a5 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 74e18cfa..1ac048c6 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index bb756634..d5fbb3a8 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 99969817..5298ffb3 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index 39f112da..de137f48 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index 955d6ffb..e1cf9a81 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index d7c3852a..7bb5aea4 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 73428d8c..7cc56c55 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index 4df6aa68..07b9b4db 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index 02cb90c5..8d4324df 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index 90c22167..1fcfbf67 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index a87659fb..0fc3067c 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 3ec3d435..8611850d 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index db93a74a..05882f11 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index 323c7d57..4f69e7b6 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index c962dbc2..391d4c53 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT gateleen-validation diff --git a/pom.xml b/pom.xml index ae4e3e3e..5cecd732 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.7-SNAPSHOT pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From 86082fd3f7cd4e12fd0ad1635d17f0cdfeb50257 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 2 May 2024 15:01:58 +0000 Subject: [PATCH 09/22] updating poms for branch'release-2.1.6' with non-snapshot versions --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 13763dd8..6b930227 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index 7afe50a7..6cad1582 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index c9d18b27..87878c9d 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index a2b58575..ea2e0c81 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index fe871810..7370bda6 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 00d652e9..8ca3c36a 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index c59c50e3..a290d6d5 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index 5b4c8d30..0825de0c 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index b483b33c..3001cfc7 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 74e18cfa..53452675 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index bb756634..14891c91 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 99969817..7e129912 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index 39f112da..b3867969 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index 955d6ffb..844897d6 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index d7c3852a..8f6b7903 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 73428d8c..77074518 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index 4df6aa68..3b69e492 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index 02cb90c5..e2dff7bf 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index 90c22167..263b28f7 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index a87659fb..fb034f15 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 3ec3d435..7ecb6e2d 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index db93a74a..45c7e76c 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index 323c7d57..6629e947 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index c962dbc2..7f225102 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 gateleen-validation diff --git a/pom.xml b/pom.xml index ae4e3e3e..418073e8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6-SNAPSHOT + 2.1.6 pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From 43c3735549f52c99fe0d675a12a7d2bca09d61f0 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 2 May 2024 15:07:33 +0000 Subject: [PATCH 10/22] updating develop poms to master versions to avoid merge conflicts --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index c4563981..6b930227 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index c6124598..6cad1582 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index 3374b224..87878c9d 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index 1fecc47b..ea2e0c81 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index cd4fa1dd..7370bda6 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 59455301..8ca3c36a 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index d0c5e3ca..a290d6d5 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index c58d33a0..0825de0c 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index 8a6ba5a5..3001cfc7 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 1ac048c6..53452675 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index d5fbb3a8..14891c91 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 5298ffb3..7e129912 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index de137f48..b3867969 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index e1cf9a81..844897d6 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index 7bb5aea4..8f6b7903 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 7cc56c55..77074518 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index 07b9b4db..3b69e492 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index 8d4324df..e2dff7bf 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index 1fcfbf67..263b28f7 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index 0fc3067c..fb034f15 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 8611850d..7ecb6e2d 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index 05882f11..45c7e76c 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index 4f69e7b6..6629e947 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index 391d4c53..7f225102 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 gateleen-validation diff --git a/pom.xml b/pom.xml index 5cecd732..418073e8 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.7-SNAPSHOT + 2.1.6 pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From 14dec8a3cbe688cbfab3655fcc2c22b5cef9795e Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 2 May 2024 15:07:35 +0000 Subject: [PATCH 11/22] Updating develop poms back to pre merge state --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 6b930227..c4563981 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index 6cad1582..c6124598 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index 87878c9d..3374b224 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index ea2e0c81..1fecc47b 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index 7370bda6..cd4fa1dd 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 8ca3c36a..59455301 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index a290d6d5..d0c5e3ca 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index 0825de0c..c58d33a0 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index 3001cfc7..8a6ba5a5 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 53452675..1ac048c6 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index 14891c91..d5fbb3a8 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 7e129912..5298ffb3 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index b3867969..de137f48 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index 844897d6..e1cf9a81 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index 8f6b7903..7bb5aea4 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 77074518..7cc56c55 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index 3b69e492..07b9b4db 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index e2dff7bf..8d4324df 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index 263b28f7..1fcfbf67 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index fb034f15..0fc3067c 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 7ecb6e2d..8611850d 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index 45c7e76c..05882f11 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index 6629e947..4f69e7b6 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index 7f225102..391d4c53 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT gateleen-validation diff --git a/pom.xml b/pom.xml index 418073e8..5cecd732 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.6 + 2.1.7-SNAPSHOT pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From e38881c2d792072494e8b68e7dec0de56d38fdf1 Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Tue, 7 May 2024 12:56:53 +0200 Subject: [PATCH 12/22] [SDCISA-15833, https://github.com/swisspost/vertx-redisques/issues/170] Fix log spam in Forwarder. --- .../gateleen/routing/AbstractForwarder.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java b/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java index b1992787..fdf9eeff 100644 --- a/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java +++ b/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java @@ -4,6 +4,7 @@ import io.vertx.core.http.HttpServerRequest; import io.vertx.ext.web.RoutingContext; import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.swisspush.gateleen.core.http.RequestLoggerFactory; import org.swisspush.gateleen.core.util.HttpHeaderUtil; import org.swisspush.gateleen.core.util.ResponseStatusCodeLogUtil; @@ -12,8 +13,11 @@ import org.swisspush.gateleen.logging.LoggingResourceManager; import org.swisspush.gateleen.monitoring.MonitoringHandler; +import static org.slf4j.LoggerFactory.getLogger; + public abstract class AbstractForwarder implements Handler { + private static final Logger log = getLogger(AbstractForwarder.class); protected final Rule rule; protected final LoggingResourceManager loggingResourceManager; protected final LogAppenderRepository logAppenderRepository; @@ -48,10 +52,15 @@ protected void respondError(HttpServerRequest req, StatusCode statusCode) { ResponseStatusCodeLogUtil.info(req, statusCode, getClass()); String msg = statusCode.getStatusMessage(); - req.response() - .setStatusCode(statusCode.getStatusCode()) - .setStatusMessage(msg) - .end(msg); + var rsp = req.response(); + if (rsp.headWritten()) { + log.warn("Response already sent. Cannot send anymore: HTTP {} {}", statusCode, msg); + } else { + req.response() + .setStatusCode(statusCode.getStatusCode()) + .setStatusMessage(msg) + .end(msg); + } } catch (IllegalStateException ex) { // (nearly) ignore because underlying connection maybe already closed RequestLoggerFactory.getLogger(getClass(), req).info("IllegalStateException while sending error response for {}", req.uri(), ex); From ccdd74cb92df54351f64cf53f451506c354a59ee Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Tue, 7 May 2024 13:10:30 +0200 Subject: [PATCH 13/22] [SDCISA-15833, https://github.com/swisspost/vertx-redisques/issues/170] Prevent stacktrace spam if response already sent. --- .../gateleen/routing/AbstractForwarder.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java b/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java index fdf9eeff..f8b1f58a 100644 --- a/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java +++ b/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java @@ -48,22 +48,24 @@ protected boolean doHeadersFilterMatch(final HttpServerRequest request) { } protected void respondError(HttpServerRequest req, StatusCode statusCode) { + Logger log = null; try { ResponseStatusCodeLogUtil.info(req, statusCode, getClass()); String msg = statusCode.getStatusMessage(); var rsp = req.response(); if (rsp.headWritten()) { - log.warn("Response already sent. Cannot send anymore: HTTP {} {}", statusCode, msg); + log = (log != null) ? log : RequestLoggerFactory.getLogger(AbstractForwarder.class, req); + log.warn("Response already sent. Cannot send: HTTP {} {}", statusCode, msg); } else { - req.response() - .setStatusCode(statusCode.getStatusCode()) - .setStatusMessage(msg) - .end(msg); + rsp.setStatusCode(statusCode.getStatusCode()); + rsp.setStatusMessage(msg); + rsp.end(msg); } } catch (IllegalStateException ex) { // (nearly) ignore because underlying connection maybe already closed - RequestLoggerFactory.getLogger(getClass(), req).info("IllegalStateException while sending error response for {}", req.uri(), ex); + log = (log != null) ? log : RequestLoggerFactory.getLogger(AbstractForwarder.class, req); + log.warn("IllegalStateException while sending error response for {}", req.uri(), ex); } } } From efea78e02432aa8f1802cbb2b66f62e8821168b6 Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Tue, 7 May 2024 13:19:05 +0200 Subject: [PATCH 14/22] [SDCISA-15833, https://github.com/swisspost/vertx-redisques/issues/170] Fix more log spam. --- .../org/swisspush/gateleen/routing/Forwarder.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/Forwarder.java b/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/Forwarder.java index c2e0dded..ddc60968 100755 --- a/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/Forwarder.java +++ b/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/Forwarder.java @@ -450,9 +450,16 @@ private Handler> getAsyncHttpClientResponseHandl HttpClientResponse cRes = asyncResult.result(); if (asyncResult.failed()) { error(asyncResult.cause().getMessage(), req, targetUri); - req.response().setStatusCode(HttpResponseStatus.INTERNAL_SERVER_ERROR.code()); - req.response().setStatusMessage(asyncResult.cause().getMessage()); - req.response().end(); + HttpServerResponse rsp = req.response(); + int rspCode = HttpResponseStatus.INTERNAL_SERVER_ERROR.code(); + String shortMsg = asyncResult.cause().getMessage(); + if (rsp.headWritten()) { + log.warn("Already responded. Cannot send anymore: HTTP {} {}", rspCode, shortMsg); + } else { + rsp.setStatusCode(rspCode); + rsp.setStatusMessage(shortMsg); + rsp.end(); + } return; } monitoringHandler.stopRequestMetricTracking(rule.getMetricName(), startTime, req.uri()); From cd579e075af9a9849ea9041492c6e86345be72f3 Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Tue, 7 May 2024 14:03:38 +0200 Subject: [PATCH 15/22] [SDCISA-15833, https://github.com/swisspost/vertx-redisques/issues/170] Cleanup unused. --- .../org/swisspush/gateleen/routing/AbstractForwarder.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java b/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java index f8b1f58a..7cab72a0 100644 --- a/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java +++ b/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/AbstractForwarder.java @@ -4,7 +4,6 @@ import io.vertx.core.http.HttpServerRequest; import io.vertx.ext.web.RoutingContext; import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.swisspush.gateleen.core.http.RequestLoggerFactory; import org.swisspush.gateleen.core.util.HttpHeaderUtil; import org.swisspush.gateleen.core.util.ResponseStatusCodeLogUtil; @@ -13,11 +12,8 @@ import org.swisspush.gateleen.logging.LoggingResourceManager; import org.swisspush.gateleen.monitoring.MonitoringHandler; -import static org.slf4j.LoggerFactory.getLogger; - public abstract class AbstractForwarder implements Handler { - private static final Logger log = getLogger(AbstractForwarder.class); protected final Rule rule; protected final LoggingResourceManager loggingResourceManager; protected final LogAppenderRepository logAppenderRepository; From 7d1e97085ef7f6ada7db446015556011b175562f Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Tue, 21 May 2024 17:00:16 +0200 Subject: [PATCH 16/22] [SDCISA-15833, https://github.com/swisspost/vertx-redisques/issues/170] Introduce ExceptionFactory --- .../exception/GateleenExceptionFactory.java | 40 +++++++++++++++++++ .../GateleenNoStackReplyException.java | 30 ++++++++++++++ .../GateleenNoStacktraceException.java | 28 +++++++++++++ .../GateleenThriftyExceptionFactory.java | 28 +++++++++++++ .../GateleenWastefulExceptionFactory.java | 28 +++++++++++++ .../core/lock/impl/RedisBasedLock.java | 31 +++++++++----- .../core/lock/impl/RedisBasedLockTest.java | 4 +- .../swisspush/gateleen/playground/Server.java | 4 +- .../gateleen/runconfig/RunConfig.java | 1 - .../org/swisspush/gateleen/AbstractTest.java | 5 ++- 10 files changed, 185 insertions(+), 14 deletions(-) create mode 100644 gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java create mode 100644 gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenNoStackReplyException.java create mode 100644 gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenNoStacktraceException.java create mode 100644 gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenThriftyExceptionFactory.java create mode 100644 gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenWastefulExceptionFactory.java diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java new file mode 100644 index 00000000..20094131 --- /dev/null +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java @@ -0,0 +1,40 @@ +package org.swisspush.gateleen.core.exception; + +import io.vertx.core.eventbus.ReplyException; +import io.vertx.core.eventbus.ReplyFailure; + + +/** + * Applies dependency inversion for exception instantiation. + * + * This class did arise because we had different use cases in different + * applications. One of them has the need to perform fine-grained error + * reporting. Whereas in the other application this led to performance issues. + * So now through this abstraction, both applications can choose the behavior + * they need. + * + * If dependency-injection gets applied properly, an app can even provide its + * custom implementation to fine-tune the exact behavior even further. + */ +public interface GateleenExceptionFactory { + + public Exception newException(String message, Throwable cause); + + public ReplyException newReplyException(ReplyFailure failureType, int failureCode, String message); + + + /** + * See {@link GateleenThriftyExceptionFactory}. + */ + public static GateleenExceptionFactory newGateleenThriftyExceptionFactory() { + return new GateleenThriftyExceptionFactory(); + } + + /** + * See {@link GateleenWastefulExceptionFactory}. + */ + public static GateleenExceptionFactory newGateleenWastefulExceptionFactory() { + return new GateleenWastefulExceptionFactory(); + } + +} diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenNoStackReplyException.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenNoStackReplyException.java new file mode 100644 index 00000000..91a384ff --- /dev/null +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenNoStackReplyException.java @@ -0,0 +1,30 @@ +package org.swisspush.gateleen.core.exception; + +import io.vertx.core.eventbus.ReplyFailure; + +/** + * There was once a fix in vertx for this (https://github.com/eclipse-vertx/vert.x/issues/4840) + * but for whatever reason in our case we still see stack-trace recordings. Passing + * this subclass to {@link io.vertx.core.eventbus.Message#reply(Object)} seems to + * do the trick. + */ +public class GateleenNoStackReplyException extends io.vertx.core.eventbus.ReplyException { + + public GateleenNoStackReplyException(ReplyFailure failureType, int failureCode, String message) { + super(failureType, failureCode, message); + } + + public GateleenNoStackReplyException(ReplyFailure failureType, String message) { + this(failureType, -1, message); + } + + public GateleenNoStackReplyException(ReplyFailure failureType) { + this(failureType, -1, null); + } + + @Override + public Throwable fillInStackTrace() { + return this; + } + +} diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenNoStacktraceException.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenNoStacktraceException.java new file mode 100644 index 00000000..36b32c45 --- /dev/null +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenNoStacktraceException.java @@ -0,0 +1,28 @@ +package org.swisspush.gateleen.core.exception; + +/** + * Basically same as in vertx, But adding the forgotten contructors. + */ +public class GateleenNoStacktraceException extends RuntimeException { + + public GateleenNoStacktraceException() { + } + + public GateleenNoStacktraceException(String message) { + super(message); + } + + public GateleenNoStacktraceException(String message, Throwable cause) { + super(message, cause); + } + + public GateleenNoStacktraceException(Throwable cause) { + super(cause); + } + + @Override + public Throwable fillInStackTrace() { + return this; + } + +} diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenThriftyExceptionFactory.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenThriftyExceptionFactory.java new file mode 100644 index 00000000..c6607ca9 --- /dev/null +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenThriftyExceptionFactory.java @@ -0,0 +1,28 @@ +package org.swisspush.gateleen.core.exception; + +import io.vertx.core.eventbus.ReplyException; +import io.vertx.core.eventbus.ReplyFailure; + +/** + * Trades maintainability for speed. For example prefers lightweight + * exceptions without stacktrace recording. It may even decide to drop 'cause' + * or other details. If an app needs more error details it should use + * {@link GateleenWastefulExceptionFactory}. If none of those fits the apps needs, it + * can provide its own implementation. + */ +class GateleenThriftyExceptionFactory implements GateleenExceptionFactory { + + GateleenThriftyExceptionFactory() { + } + + public Exception newException(String message, Throwable cause) { + if (cause instanceof Exception) return (Exception) cause; + return new GateleenNoStacktraceException(message, cause); + } + + @Override + public ReplyException newReplyException(ReplyFailure failureType, int failureCode, String message) { + return new GateleenNoStackReplyException(failureType, failureCode, message); + } + +} diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenWastefulExceptionFactory.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenWastefulExceptionFactory.java new file mode 100644 index 00000000..aa89d844 --- /dev/null +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenWastefulExceptionFactory.java @@ -0,0 +1,28 @@ +package org.swisspush.gateleen.core.exception; + +import io.vertx.core.eventbus.ReplyException; +import io.vertx.core.eventbus.ReplyFailure; + +/** + * Trades speed for maintainability. For example invests more resources like + * recording stack traces (which likely provocates more logs) to get easier + * to debug error messages and better hints of what is happening. It also + * keeps details like 'causes' and 'suppressed' exceptions. If an app needs + * more error details it should use {@link GateleenWastefulExceptionFactory}. If none + * of those fits the apps needs, it can provide its own implementation. + */ +class GateleenWastefulExceptionFactory implements GateleenExceptionFactory { + + GateleenWastefulExceptionFactory() { + } + + public Exception newException(String message, Throwable cause) { + return new Exception(message, cause); + } + + @Override + public ReplyException newReplyException(ReplyFailure failureType, int failureCode, String message) { + return new ReplyException(failureType, failureCode, message); + } + +} diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLock.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLock.java index 84197386..7f359df3 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLock.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLock.java @@ -9,6 +9,7 @@ import io.vertx.redis.client.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.lock.Lock; import org.swisspush.gateleen.core.lock.lua.LockLuaScripts; import org.swisspush.gateleen.core.lock.lua.ReleaseLockRedisCommand; @@ -28,14 +29,17 @@ public class RedisBasedLock implements Lock { private static final Logger log = LoggerFactory.getLogger(RedisBasedLock.class); + private static final String[] EMPTY_STRING_ARRAY = new String[0]; public static final String STORAGE_PREFIX = "gateleen.core-lock:"; private final LuaScriptState releaseLockLuaScriptState; private final RedisProvider redisProvider; + private final GateleenExceptionFactory exceptionFactory; - public RedisBasedLock(RedisProvider redisProvider) { + public RedisBasedLock(RedisProvider redisProvider, GateleenExceptionFactory exceptionFactory) { this.redisProvider = redisProvider; + this.exceptionFactory = exceptionFactory; this.releaseLockLuaScriptState = new LuaScriptState(LockLuaScripts.LOCK_RELEASE, redisProvider, false); } @@ -47,22 +51,28 @@ private void redisSetWithOptions(String key, String value, boolean nx, long px, } redisProvider.redis().onComplete( redisEv -> { if( redisEv.failed() ){ - handler.handle(new FailedAsyncResult<>(redisEv.cause())); + Throwable ex = exceptionFactory.newException("redisProvider.redis() failed", redisEv.cause()); + handler.handle(new FailedAsyncResult<>(ex)); return; } var redisAPI = redisEv.result(); - redisAPI.send(Command.SET, RedisUtils.toPayload(key, value, options).toArray(new String[0])) - .onComplete( ev -> { - if( ev.failed() && log.isInfoEnabled() ) log.info("stacktrace", new Exception("stacktrace", ev.cause())); - handler.handle(ev); - }); + String[] payload = RedisUtils.toPayload(key, value, options).toArray(EMPTY_STRING_ARRAY); + redisAPI.send(Command.SET, payload).onComplete(ev -> { + if (ev.failed()) { + Throwable ex = exceptionFactory.newException("redisAPI.send() failed", ev.cause()); + handler.handle(new FailedAsyncResult<>(ex)); + return; + } + handler.handle(ev); + }); }); } @Override public Future acquireLock(String lock, String token, long lockExpiryMs) { Promise promise = Promise.promise(); - redisSetWithOptions(buildLockKey(lock), token, true, lockExpiryMs, event -> { + String lockKey = buildLockKey(lock); + redisSetWithOptions(lockKey, token, true, lockExpiryMs, event -> { if (event.succeeded()) { if (event.result() != null) { promise.complete("OK".equalsIgnoreCase(event.result().toString())); @@ -70,8 +80,9 @@ public Future acquireLock(String lock, String token, long lockExpiryMs) promise.complete(false); } } else { - if( log.isInfoEnabled() ) log.info("stacktrace", new Exception("stacktrace", event.cause())); - promise.fail(event.cause().getMessage()); + Throwable ex = exceptionFactory.newException( + "redisSetWithOptions(lockKey=\"" + lockKey + "\") failed", event.cause()); + promise.fail(ex); } }); return promise.future(); diff --git a/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLockTest.java b/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLockTest.java index d0f0e2a3..29f0b02f 100644 --- a/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLockTest.java +++ b/gateleen-core/src/test/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLockTest.java @@ -17,6 +17,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import redis.clients.jedis.Jedis; import redis.clients.jedis.exceptions.JedisConnectionException; @@ -24,6 +25,7 @@ import static org.awaitility.Awaitility.await; import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; /** * Tests for the {@link RedisBasedLock} class @@ -48,7 +50,7 @@ public static void setupLock(){ vertx = Vertx.vertx(); RedisAPI redisAPI = RedisAPI.api(new RedisClient(vertx, new NetClientOptions(), new PoolOptions(), new RedisStandaloneConnectOptions(), TracingPolicy.IGNORE)); - redisBasedLock = new RedisBasedLock(() -> Future.succeededFuture(redisAPI)); + redisBasedLock = new RedisBasedLock(() -> Future.succeededFuture(redisAPI), newGateleenWastefulExceptionFactory()); } @Before diff --git a/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java b/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java index 48bbeb03..212dd866 100755 --- a/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java +++ b/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java @@ -86,6 +86,8 @@ import java.util.Arrays; import java.util.Map; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; + /** * Playground server to try Gateleen at home. * @@ -214,7 +216,7 @@ public void start() { copyResourceHandler = new CopyResourceHandler(selfClient, SERVER_ROOT + "/v1/copy"); monitoringHandler = new MonitoringHandler(vertx, storage, PREFIX, SERVER_ROOT + "/monitoring/rpr"); - Lock lock = new RedisBasedLock(redisProvider); + Lock lock = new RedisBasedLock(redisProvider, newGateleenWastefulExceptionFactory()); cacheStorage = new RedisCacheStorage(vertx, lock, redisProvider, 20 * 1000); cacheDataFetcher = new DefaultCacheDataFetcher(new ClientRequestCreator(selfClient)); diff --git a/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java b/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java index 824add3a..2d904301 100755 --- a/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java +++ b/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java @@ -38,7 +38,6 @@ import org.swisspush.gateleen.queue.queuing.QueueBrowser; import org.swisspush.gateleen.queue.queuing.QueuingHandler; import org.swisspush.gateleen.queue.queuing.circuitbreaker.configuration.QueueCircuitBreakerConfigurationResourceManager; -import org.swisspush.gateleen.queue.queuing.splitter.NoOpQueueSplitter; import org.swisspush.gateleen.queue.queuing.splitter.QueueSplitter; import org.swisspush.gateleen.routing.CustomHttpResponseHandler; import org.swisspush.gateleen.routing.Router; diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java index c06a011f..c9943666 100755 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java @@ -73,6 +73,7 @@ import org.swisspush.gateleen.scheduler.SchedulerResourceManager; import org.swisspush.gateleen.user.RoleProfileHandler; import org.swisspush.gateleen.user.UserProfileHandler; +import org.swisspush.reststorage.exception.RestStorageExceptionFactory; import redis.clients.jedis.Jedis; import javax.management.*; @@ -82,6 +83,8 @@ import java.util.Map; import java.util.Set; +import static org.swisspush.reststorage.exception.RestStorageExceptionFactory.newRestStorageWastefulExceptionFactory; + /** * TestVerticle all Gateleen tests.
* @@ -170,7 +173,7 @@ public static void setupBeforeClass(TestContext context) { RoleProfileHandler roleProfileHandler = new RoleProfileHandler(vertx, storage, SERVER_ROOT + "/roles/v1/([^/]+)/profile"); qosHandler = new QoSHandler(vertx, storage, SERVER_ROOT + "/admin/v1/qos", props, PREFIX); - Lock lock = new RedisBasedLock(redisProvider); + Lock lock = new RedisBasedLock(redisProvider, newRestStorageWastefulExceptionFactory()); QueueClient queueClient = new QueueClient(vertx, monitoringHandler); ReducedPropagationManager reducedPropagationManager = new ReducedPropagationManager(vertx, From d7506f0ad251d3385791d8d9d4ad202c12df54f5 Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Tue, 21 May 2024 17:29:28 +0200 Subject: [PATCH 17/22] Reword JavaDoc Related: SDCISA-15833, https://github.com/swisspost/vertx-redisques/issues/170, https://github.com/swisspost/vertx-redisques/pull/177, https://github.com/swisspost/vertx-rest-storage/pull/186, https://github.com/swisspost/gateleen/pull/577 --- .../core/exception/GateleenExceptionFactory.java | 14 ++++++++++++-- .../exception/GateleenThriftyExceptionFactory.java | 6 +----- .../GateleenWastefulExceptionFactory.java | 7 +------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java index 20094131..9154af41 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java @@ -13,8 +13,18 @@ * So now through this abstraction, both applications can choose the behavior * they need. * - * If dependency-injection gets applied properly, an app can even provide its - * custom implementation to fine-tune the exact behavior even further. + * There are two default options an app can use (if it does not want to provide + * a custom impl). + * One is {@link GateleenThriftyExceptionFactory}. It trades maintainability + * for speed. For example prefers lightweight exceptions without stacktrace + * recording. Plus it may apply other tricks to reduce resource costs. + * The other one is {@link GateleenWastefulExceptionFactory}. It trades speed + * for maintainability. So it tries to track as much error details as possible. + * For example recording stack traces, keeping 'cause' and 'suppressed' + * exceptions, plus maybe more. + * + * If none of those defaults matches, an app can provide its custom + * implementation via dependency injection. */ public interface GateleenExceptionFactory { diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenThriftyExceptionFactory.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenThriftyExceptionFactory.java index c6607ca9..1a26ae48 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenThriftyExceptionFactory.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenThriftyExceptionFactory.java @@ -4,11 +4,7 @@ import io.vertx.core.eventbus.ReplyFailure; /** - * Trades maintainability for speed. For example prefers lightweight - * exceptions without stacktrace recording. It may even decide to drop 'cause' - * or other details. If an app needs more error details it should use - * {@link GateleenWastefulExceptionFactory}. If none of those fits the apps needs, it - * can provide its own implementation. + * See {@link GateleenExceptionFactory} for details. */ class GateleenThriftyExceptionFactory implements GateleenExceptionFactory { diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenWastefulExceptionFactory.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenWastefulExceptionFactory.java index aa89d844..1fc0889c 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenWastefulExceptionFactory.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenWastefulExceptionFactory.java @@ -4,12 +4,7 @@ import io.vertx.core.eventbus.ReplyFailure; /** - * Trades speed for maintainability. For example invests more resources like - * recording stack traces (which likely provocates more logs) to get easier - * to debug error messages and better hints of what is happening. It also - * keeps details like 'causes' and 'suppressed' exceptions. If an app needs - * more error details it should use {@link GateleenWastefulExceptionFactory}. If none - * of those fits the apps needs, it can provide its own implementation. + * See {@link GateleenExceptionFactory} for details. */ class GateleenWastefulExceptionFactory implements GateleenExceptionFactory { From 4ff110218c3c6c19354aa5cc3bbd1b70014d904c Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Tue, 21 May 2024 19:59:11 +0200 Subject: [PATCH 18/22] Fix test Related: SDCISA-15833, https://github.com/swisspost/vertx-redisques/issues/170, https://github.com/swisspost/vertx-redisques/pull/177, https://github.com/swisspost/vertx-rest-storage/pull/186, https://github.com/swisspost/gateleen/pull/577 --- .../src/test/java/org/swisspush/gateleen/AbstractTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java index c9943666..dd04f701 100755 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java @@ -73,7 +73,6 @@ import org.swisspush.gateleen.scheduler.SchedulerResourceManager; import org.swisspush.gateleen.user.RoleProfileHandler; import org.swisspush.gateleen.user.UserProfileHandler; -import org.swisspush.reststorage.exception.RestStorageExceptionFactory; import redis.clients.jedis.Jedis; import javax.management.*; @@ -83,7 +82,7 @@ import java.util.Map; import java.util.Set; -import static org.swisspush.reststorage.exception.RestStorageExceptionFactory.newRestStorageWastefulExceptionFactory; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; /** * TestVerticle all Gateleen tests.
@@ -173,7 +172,7 @@ public static void setupBeforeClass(TestContext context) { RoleProfileHandler roleProfileHandler = new RoleProfileHandler(vertx, storage, SERVER_ROOT + "/roles/v1/([^/]+)/profile"); qosHandler = new QoSHandler(vertx, storage, SERVER_ROOT + "/admin/v1/qos", props, PREFIX); - Lock lock = new RedisBasedLock(redisProvider, newRestStorageWastefulExceptionFactory()); + Lock lock = new RedisBasedLock(redisProvider, newGateleenWastefulExceptionFactory()); QueueClient queueClient = new QueueClient(vertx, monitoringHandler); ReducedPropagationManager reducedPropagationManager = new ReducedPropagationManager(vertx, From 34215a582f6c965c48335c8d500338b6cbe977b8 Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Thu, 23 May 2024 15:36:48 +0200 Subject: [PATCH 19/22] Fix some for 'https://github.com/swisspost/gateleen/pull/577#pullrequestreview-2070233347' Related: SDCISA-15833, https://github.com/swisspost/vertx-redisques/issues/170, https://github.com/swisspost/vertx-redisques/pull/177, https://github.com/swisspost/vertx-rest-storage/pull/186, https://github.com/swisspost/gateleen/pull/577 --- .../ConfigurationResourceManager.java | 19 ++++++++----- .../exception/GateleenExceptionFactory.java | 8 +++++- .../core/http/LocalHttpClientRequest.java | 15 ++++++++--- .../lock/lua/ReleaseLockRedisCommand.java | 25 ++++++++++++----- .../gateleen/core/lua/LuaScriptState.java | 20 +++++++++----- .../core/resource/CopyResourceHandler.java | 27 ++++++++++++------- 6 files changed, 82 insertions(+), 32 deletions(-) diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManager.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManager.java index 5e2a9771..0583ff8b 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManager.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManager.java @@ -11,6 +11,7 @@ import io.vertx.core.json.JsonObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.RequestLoggerFactory; import org.swisspush.gateleen.core.logging.LoggableResource; import org.swisspush.gateleen.core.logging.RequestLogger; @@ -35,6 +36,7 @@ public class ConfigurationResourceManager implements LoggableResource { private final Vertx vertx; private final ResourceStorage storage; + private final GateleenExceptionFactory exceptionFactory; private Map registeredResources; private Map> observers; private final ConfigurationResourceValidator configurationResourceValidator; @@ -44,9 +46,14 @@ public class ConfigurationResourceManager implements LoggableResource { private static final String MESSAGE_REQUEST_URI = "requestUri"; private static final String MESSAGE_RESOURCE_TYPE = "type"; - public ConfigurationResourceManager(Vertx vertx, final ResourceStorage storage) { + public ConfigurationResourceManager( + Vertx vertx, + ResourceStorage storage, + GateleenExceptionFactory exceptionFactory + ) { this.vertx = vertx; this.storage = storage; + this.exceptionFactory = exceptionFactory; this.configurationResourceValidator = new ConfigurationResourceValidator(vertx); @@ -192,11 +199,11 @@ private Future> getValidatedRegisteredResource(String resourceU if (event.result().isSuccess()) { promise.complete(Optional.of(buffer)); } else { - promise.fail(new Exception("Failure during validation of resource " + promise.fail(exceptionFactory.newException("Failure during validation of resource " + resourceUri + ". Message: " + event.result().getMessage())); } } else { - promise.fail(new Exception("ReleaseLockRedisCommand request failed", event.cause())); + promise.fail(exceptionFactory.newException("ReleaseLockRedisCommand request failed", event.cause())); } }); } else { @@ -217,9 +224,9 @@ private void notifyObserversAboutRemovedResource(String requestUri) { private void notifyObserverAboutResourceChange(String requestUri, ConfigurationResourceObserver observer) { getValidatedRegisteredResource(requestUri).onComplete(event -> { - if(event.failed()){ - log.warn("TODO error handling", new Exception(event.cause())); - } else if(event.result().isPresent()){ + if (event.failed()) { + log.warn("stacktrace", exceptionFactory.newException("TODO error handling", event.cause())); + } else if (event.result().isPresent()) { if(observer != null) { observer.resourceChanged(requestUri, event.result().get()); } else { diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java index 9154af41..af7db1e5 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/exception/GateleenExceptionFactory.java @@ -28,7 +28,13 @@ */ public interface GateleenExceptionFactory { - public Exception newException(String message, Throwable cause); + /** Convenience overload for {@link #newException(String, Throwable)}. */ + public default Exception newException(String msg){ return newException(msg, null); } + + /** Convenience overload for {@link #newException(String, Throwable)}. */ + public default Exception newException(Throwable cause){ return newException(null, cause); } + + public Exception newException(String msg, Throwable cause); public ReplyException newReplyException(ReplyFailure failureType, int failureCode, String message); diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClientRequest.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClientRequest.java index fb152839..5cdc3b71 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClientRequest.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClientRequest.java @@ -15,6 +15,7 @@ import io.vertx.ext.auth.User; import io.vertx.ext.web.*; import org.slf4j.Logger; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import javax.net.ssl.SSLSession; import javax.security.cert.X509Certificate; @@ -44,6 +45,7 @@ public class LocalHttpClientRequest extends BufferBridge implements FastFailHttp private HttpServerResponse serverResponse; private final HttpConnection connection; private Handler routingContextHandler; + private final GateleenExceptionFactory exceptionFactory; private boolean bound = false; private static final SocketAddress address = new SocketAddressImpl(0, "localhost"); @@ -538,11 +540,19 @@ public MultiMap queryParams(Charset charset) { } }; - public LocalHttpClientRequest(HttpMethod method, String uri, Vertx vertx, Handler routingContextHandler, HttpServerResponse response) { + public LocalHttpClientRequest( + HttpMethod method, + String uri, + Vertx vertx, + Handler routingContextHandler, + GateleenExceptionFactory exceptionFactory, + HttpServerResponse response + ) { super(vertx); this.method = method; this.uri = uri; this.routingContextHandler = routingContextHandler; + this.exceptionFactory = exceptionFactory; this.serverResponse = response; this.connection = new LocalHttpConnection(); } @@ -854,8 +864,7 @@ public boolean writeQueueFull() { @Override public HttpClientRequest drainHandler(Handler handler) { - log.warn("Happy debugging, as this impl will just ignore your drainHandler anyway", - new Exception("may this stacktrace lead you where this problem comes from")); + log.warn("stacktrace", exceptionFactory.newException("TODO impl drainHandler")); return this; } diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/lua/ReleaseLockRedisCommand.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/lua/ReleaseLockRedisCommand.java index 03f6e628..c7c058dc 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/lua/ReleaseLockRedisCommand.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/lua/ReleaseLockRedisCommand.java @@ -3,6 +3,7 @@ import io.vertx.core.Promise; import io.vertx.redis.client.RedisAPI; import org.slf4j.Logger; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.lua.LuaScriptState; import org.swisspush.gateleen.core.lua.RedisCommand; import org.swisspush.gateleen.core.redis.RedisProvider; @@ -20,14 +21,23 @@ public class ReleaseLockRedisCommand implements RedisCommand { private List arguments; private Promise promise; private RedisProvider redisProvider; + private final GateleenExceptionFactory exceptionFactory; private Logger log; - public ReleaseLockRedisCommand(LuaScriptState luaScriptState, List keys, List arguments, - RedisProvider redisProvider, Logger log, final Promise promise) { + public ReleaseLockRedisCommand( + LuaScriptState luaScriptState, + List keys, + List arguments, + RedisProvider redisProvider, + GateleenExceptionFactory exceptionFactory, + Logger log, + final Promise promise + ) { this.luaScriptState = luaScriptState; this.keys = keys; this.arguments = arguments; this.redisProvider = redisProvider; + this.exceptionFactory = exceptionFactory; this.log = log; this.promise = promise; } @@ -42,7 +52,7 @@ public void exec(int executionCounter) { redisProvider.redis().onComplete( redisEv -> { if( redisEv.failed() ){ - promise.fail(new Exception("redisProvider.redis()", redisEv.cause())); + promise.fail(exceptionFactory.newException("redisProvider.redis() failed", redisEv.cause())); return; } RedisAPI redisAPI = redisEv.result(); @@ -54,16 +64,17 @@ public void exec(int executionCounter) { Throwable ex = event.cause(); String message = ex.getMessage(); if (message != null && message.startsWith("NOSCRIPT")) { - log.warn("ReleaseLockRedisCommand script couldn't be found, reload it", new Exception("stacktrace",ex)); + log.warn("ReleaseLockRedisCommand script couldn't be found, reload it", + exceptionFactory.newException(ex)); log.warn("amount the script got loaded: {}", executionCounter); if (executionCounter > 10) { - promise.fail(new Exception("amount the script got loaded is higher than 10, we abort")); + promise.fail(exceptionFactory.newException("amount the script got loaded is higher than 10, we abort")); } else { luaScriptState.loadLuaScript(new ReleaseLockRedisCommand(luaScriptState, keys, - arguments, redisProvider, log, promise), executionCounter); + arguments, redisProvider, exceptionFactory, log, promise), executionCounter); } } else { - promise.fail(new Exception("ReleaseLockRedisCommand request failed", ex)); + promise.fail(exceptionFactory.newException("ReleaseLockRedisCommand request failed", ex)); } } }); diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/lua/LuaScriptState.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/lua/LuaScriptState.java index 5bb5e92f..81f00092 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/lua/LuaScriptState.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/lua/LuaScriptState.java @@ -4,6 +4,7 @@ import org.apache.commons.codec.digest.DigestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.redis.RedisProvider; import java.io.BufferedReader; @@ -30,12 +31,19 @@ public class LuaScriptState { private String sha; private RedisProvider redisProvider; + private final GateleenExceptionFactory exceptionFactory; private Logger log = LoggerFactory.getLogger(LuaScriptState.class); - public LuaScriptState(LuaScript luaScriptType, RedisProvider redisProvider, boolean logoutput) { + public LuaScriptState( + LuaScript luaScriptType, + RedisProvider redisProvider, + GateleenExceptionFactory exceptionFactory, + boolean logoutput + ) { this.luaScriptType = luaScriptType; this.redisProvider = redisProvider; + this.exceptionFactory = exceptionFactory; this.logoutput = logoutput; this.composeLuaScript(luaScriptType); this.loadLuaScript(new RedisCommandDoNothing(), 0); @@ -87,17 +95,17 @@ private String readLuaScriptFromClasspath(LuaScript luaScriptType) { public void loadLuaScript(final RedisCommand redisCommand, int executionCounter) { final int executionCounterIncr = ++executionCounter; // check first if the lua script already exists in the store - redisProvider.redis().onComplete( redisEv -> { + redisProvider.redis().onComplete(redisEv -> { if (redisEv.failed()) { - log.error("Redis: Error checking whether lua script exists", - new Exception("stacktrace", redisEv.cause())); + log.error("stacktrace", exceptionFactory.newException( + "redisProvider.redis() failed", redisEv.cause())); return; } RedisAPI redisAPI = redisEv.result(); redisAPI.script(Arrays.asList("exists", sha), resultArray -> { if (resultArray.failed()) { - log.error("Error checking whether lua script exists", - new Exception("stacktrace", resultArray.cause())); + log.error("stacktrace", exceptionFactory.newException( + "redisAPI.script(['exists', sha]) failed", resultArray.cause())); return; } Long exists = resultArray.result().get(0).toLong(); diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/resource/CopyResourceHandler.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/resource/CopyResourceHandler.java index f0913a6e..17709e91 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/resource/CopyResourceHandler.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/resource/CopyResourceHandler.java @@ -7,6 +7,7 @@ import io.vertx.core.json.JsonObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.HeaderFunction; import org.swisspush.gateleen.core.http.HeaderFunctions; import org.swisspush.gateleen.core.http.RequestLoggerFactory; @@ -25,11 +26,13 @@ public class CopyResourceHandler { private static final String SLASH = "/"; private static final int DEFAULT_TIMEOUT = 120000; - private final String copyPath; private final HttpClient selfClient; + private final GateleenExceptionFactory exceptionFactory; + private final String copyPath; - public CopyResourceHandler(HttpClient selfClient, String copyPath) { + public CopyResourceHandler(HttpClient selfClient, GateleenExceptionFactory exceptionFactory, String copyPath) { this.selfClient = selfClient; + this.exceptionFactory = exceptionFactory; this.copyPath = copyPath; } @@ -94,7 +97,8 @@ protected void performGETRequest(final HttpServerRequest request, final CopyTask selfClient.request(HttpMethod.GET, task.getSourceUri()).onComplete(event -> { if (event.failed()) { - log.warn("Failed request to {}", request.uri(), new Exception("stacktrace", event.cause())); + log.warn("stacktrace", exceptionFactory.newException( + "Failed request to " + request.uri(), event.cause())); return; } HttpClientRequest selfRequest = event.result(); @@ -105,12 +109,16 @@ protected void performGETRequest(final HttpServerRequest request, final CopyTask selfRequest.idleTimeout(DEFAULT_TIMEOUT); // add exception handler - selfRequest.exceptionHandler( ex -> log.warn("CopyResourceHandler: GET request failed: {}", request.uri(), new Exception("stacktrace", ex))); + selfRequest.exceptionHandler(ex -> { + log.warn("stacktrace", exceptionFactory.newException( + "CopyResourceHandler: GET request failed: " + request.uri(), ex)); + }); // fire selfRequest.send(asyncResult -> { - if( asyncResult.failed() ){ - log.warn("stacktrace", new Exception("stacktrace", asyncResult.cause())); + if (asyncResult.failed()) { + log.warn("stacktrace", exceptionFactory.newException( + "selfRequest.send() failed", asyncResult.cause())); return; } HttpClientResponse response = asyncResult.result(); @@ -138,7 +146,7 @@ protected void performPUTRequest(final HttpServerRequest request, final HttpClie selfClient.request(HttpMethod.PUT, task.getDestinationUri()).onComplete(event -> { if (event.failed()) { - log.warn("Failed request to {}", request.uri(), new Exception("stacktrace", event.cause())); + log.warn("Failed request to {}", request.uri(), exceptionFactory.newException(event.cause())); return; } HttpClientRequest selfRequest = event.result(); @@ -154,8 +162,9 @@ protected void performPUTRequest(final HttpServerRequest request, final HttpClie // fire selfRequest.send(asyncResult -> { - if( asyncResult.failed() ){ - log.warn("stacktrace", new Exception("stacktrace", asyncResult.cause())); + if (asyncResult.failed()) { + log.warn("stacktrace", exceptionFactory.newException( + "selfRequest.send() failed", asyncResult.cause())); return; } HttpClientResponse response = asyncResult.result(); From e96694995b3e736670dad5ecb0319d62fc84e74c Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Thu, 23 May 2024 16:56:33 +0200 Subject: [PATCH 20/22] Fix 'https://github.com/swisspost/gateleen/pull/577#pullrequestreview-2070233347' Related: SDCISA-15833, https://github.com/swisspost/vertx-redisques/issues/170, https://github.com/swisspost/vertx-redisques/pull/177, https://github.com/swisspost/vertx-rest-storage/pull/186, https://github.com/swisspost/gateleen/pull/577 --- .../cache/storage/RedisCacheStorage.java | 19 ++++++-- .../cache/storage/RedisCacheStorageTest.java | 5 +- .../gateleen/core/http/LocalHttpClient.java | 7 ++- .../core/lock/impl/RedisBasedLock.java | 4 +- .../core/storage/EventBusResourceStorage.java | 25 +++++----- .../core/storage/HttpResourceStorage.java | 46 ++++++++++++------- .../gateleen/core/util/LockUtil.java | 12 +++-- .../ConfigurationResourceManagerTest.java | 34 +++++++------- .../resource/CopyResourceHandlerTest.java | 6 ++- .../gateleen/core/util/LockUtilTest.java | 11 +++-- .../gateleen/delegate/DelegateTest.java | 5 +- .../ReducedPropagationManager.java | 15 ++++-- .../impl/RedisReducedPropagationStorage.java | 7 +-- .../ReducedPropagationManagerTest.java | 5 +- ...tionStorageAddQueueMultipleQueuesTest.java | 5 +- ...onStorageRemoveExpiredQueuesEmptyTest.java | 5 +- .../RedisReducedPropagationStorageTest.java | 5 +- .../gateleen/kafka/KafkaHandlerTest.java | 5 +- .../swisspush/gateleen/playground/Server.java | 20 ++++---- .../queue/queuing/QueueProcessor.java | 19 ++++++-- .../impl/QueueCircuitBreakerImpl.java | 24 ++++++++-- .../impl/RedisQueueCircuitBreakerStorage.java | 15 +++--- .../queue/queuing/QueueProcessorTest.java | 9 ++-- .../impl/QueueCircuitBreakerImplTest.java | 4 +- .../RedisQueueCircuitBreakerStorageTest.java | 4 +- .../splitter/QueueSplitterImplTest.java | 5 +- .../gateleen/scheduler/Scheduler.java | 24 ++++++++-- .../gateleen/scheduler/SchedulerFactory.java | 18 ++++++-- .../scheduler/SchedulerResourceManager.java | 21 +++++++-- .../scheduler/SchedulerFactoryTest.java | 9 ++-- .../ContentTypeConstraintHandlerTest.java | 3 +- .../org/swisspush/gateleen/AbstractTest.java | 21 +++++---- .../DefaultValidationSchemaProviderTest.java | 3 +- 33 files changed, 285 insertions(+), 135 deletions(-) diff --git a/gateleen-cache/src/main/java/org/swisspush/gateleen/cache/storage/RedisCacheStorage.java b/gateleen-cache/src/main/java/org/swisspush/gateleen/cache/storage/RedisCacheStorage.java index d2262fdd..147b565a 100644 --- a/gateleen-cache/src/main/java/org/swisspush/gateleen/cache/storage/RedisCacheStorage.java +++ b/gateleen-cache/src/main/java/org/swisspush/gateleen/cache/storage/RedisCacheStorage.java @@ -8,10 +8,12 @@ import io.vertx.core.json.JsonArray; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.lock.Lock; import org.swisspush.gateleen.core.lua.LuaScriptState; import org.swisspush.gateleen.core.redis.RedisProvider; import org.swisspush.gateleen.core.util.Address; +import org.swisspush.gateleen.core.util.LockUtil; import java.time.Duration; import java.util.Collections; @@ -22,13 +24,13 @@ import java.util.stream.IntStream; import static org.swisspush.gateleen.core.util.LockUtil.acquireLock; -import static org.swisspush.gateleen.core.util.LockUtil.releaseLock; public class RedisCacheStorage implements CacheStorage { private Logger log = LoggerFactory.getLogger(RedisCacheStorage.class); private final Lock lock; + private final LockUtil lockUtil; private final RedisProvider redisProvider; private LuaScriptState clearCacheLuaScriptState; private LuaScriptState cacheRequestLuaScriptState; @@ -37,11 +39,18 @@ public class RedisCacheStorage implements CacheStorage { public static final String CACHE_PREFIX = "gateleen.cache:"; public static final String STORAGE_CLEANUP_TASK_LOCK = "cacheStorageCleanupTask"; - public RedisCacheStorage(Vertx vertx, Lock lock, RedisProvider redisProvider, long storageCleanupIntervalMs) { + public RedisCacheStorage( + Vertx vertx, + Lock lock, + RedisProvider redisProvider, + GateleenExceptionFactory exceptionFactory, + long storageCleanupIntervalMs + ) { this.lock = lock; + this.lockUtil = new LockUtil(exceptionFactory); this.redisProvider = redisProvider; - clearCacheLuaScriptState = new LuaScriptState(CacheLuaScripts.CLEAR_CACHE, redisProvider, false); - cacheRequestLuaScriptState = new LuaScriptState(CacheLuaScripts.CACHE_REQUEST, redisProvider, false); + clearCacheLuaScriptState = new LuaScriptState(CacheLuaScripts.CLEAR_CACHE, redisProvider, exceptionFactory, false); + cacheRequestLuaScriptState = new LuaScriptState(CacheLuaScripts.CACHE_REQUEST, redisProvider, exceptionFactory, false); vertx.setPeriodic(storageCleanupIntervalMs, event -> { String token = token(STORAGE_CLEANUP_TASK_LOCK); @@ -51,7 +60,7 @@ public RedisCacheStorage(Vertx vertx, Lock lock, RedisProvider redisProvider, lo cleanup().onComplete(cleanupResult -> { if (cleanupResult.failed()) { log.warn("storage cleanup has failed", cleanupResult.cause()); - releaseLock(lock, STORAGE_CLEANUP_TASK_LOCK, token, log); + lockUtil.releaseLock(lock, STORAGE_CLEANUP_TASK_LOCK, token, log); } else { log.debug("Successfully cleaned {} entries from storage", cleanupResult.result()); } diff --git a/gateleen-cache/src/test/java/org/swisspush/gateleen/cache/storage/RedisCacheStorageTest.java b/gateleen-cache/src/test/java/org/swisspush/gateleen/cache/storage/RedisCacheStorageTest.java index 04c160cf..1849bc01 100644 --- a/gateleen-cache/src/test/java/org/swisspush/gateleen/cache/storage/RedisCacheStorageTest.java +++ b/gateleen-cache/src/test/java/org/swisspush/gateleen/cache/storage/RedisCacheStorageTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.lock.Lock; import redis.clients.jedis.HostAndPort; import redis.clients.jedis.Jedis; @@ -37,6 +38,7 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.swisspush.gateleen.cache.storage.RedisCacheStorage.CACHED_REQUESTS; import static org.swisspush.gateleen.cache.storage.RedisCacheStorage.CACHE_PREFIX; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; /** * Tests for the {@link RedisCacheStorage} class @@ -50,6 +52,7 @@ public class RedisCacheStorageTest { public Timeout rule = Timeout.seconds(50); private Vertx vertx; + private final GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private Lock lock; private Jedis jedis; private RedisCacheStorage redisCacheStorage; @@ -65,7 +68,7 @@ public void setUp() { RedisAPI redisAPI = RedisAPI.api(new RedisClient(vertx, new NetClientOptions(), new PoolOptions(), new RedisStandaloneConnectOptions(), TracingPolicy.IGNORE)); - redisCacheStorage = new RedisCacheStorage(vertx, lock, () -> Future.succeededFuture(redisAPI), 2000); + redisCacheStorage = new RedisCacheStorage(vertx, lock, () -> Future.succeededFuture(redisAPI), exceptionFactory, 2000); jedis = new Jedis(new HostAndPort("localhost", 6379)); try { jedis.flushAll(); diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClient.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClient.java index 07848ea7..2d02b7ef 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClient.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/http/LocalHttpClient.java @@ -5,6 +5,7 @@ import io.vertx.core.http.HttpClientRequest; import io.vertx.core.http.HttpMethod; import io.vertx.ext.web.RoutingContext; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; /** * Created by bovetl on 22.01.2015. @@ -13,10 +14,12 @@ public class LocalHttpClient extends AbstractHttpClient { private Handler wrappedRoutingContexttHandler; private Vertx vertx; + private final GateleenExceptionFactory exceptionFactory; - public LocalHttpClient(Vertx vertx) { + public LocalHttpClient(Vertx vertx, GateleenExceptionFactory exceptionFactory) { super(vertx); this.vertx = vertx; + this.exceptionFactory = exceptionFactory; } public void setRoutingContexttHandler(Handler wrappedRoutingContexttHandler) { @@ -25,6 +28,6 @@ public void setRoutingContexttHandler(Handler wrappedRoutingCont @Override protected HttpClientRequest doRequest(HttpMethod method, String uri) { - return new LocalHttpClientRequest(method, uri, vertx, wrappedRoutingContexttHandler, new LocalHttpServerResponse(vertx)); + return new LocalHttpClientRequest(method, uri, vertx, wrappedRoutingContexttHandler, exceptionFactory, new LocalHttpServerResponse(vertx)); } } diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLock.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLock.java index 7f359df3..a89761f4 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLock.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/lock/impl/RedisBasedLock.java @@ -40,7 +40,7 @@ public class RedisBasedLock implements Lock { public RedisBasedLock(RedisProvider redisProvider, GateleenExceptionFactory exceptionFactory) { this.redisProvider = redisProvider; this.exceptionFactory = exceptionFactory; - this.releaseLockLuaScriptState = new LuaScriptState(LockLuaScripts.LOCK_RELEASE, redisProvider, false); + this.releaseLockLuaScriptState = new LuaScriptState(LockLuaScripts.LOCK_RELEASE, redisProvider, exceptionFactory, false); } private void redisSetWithOptions(String key, String value, boolean nx, long px, Handler> handler) { @@ -94,7 +94,7 @@ public Future releaseLock(String lock, String token) { List keys = Collections.singletonList(buildLockKey(lock)); List arguments = Collections.singletonList(token); ReleaseLockRedisCommand cmd = new ReleaseLockRedisCommand(releaseLockLuaScriptState, - keys, arguments, redisProvider, log, promise); + keys, arguments, redisProvider, exceptionFactory, log, promise); cmd.exec(0); return promise.future(); } diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/storage/EventBusResourceStorage.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/storage/EventBusResourceStorage.java index c4a699b8..9b9c6aab 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/storage/EventBusResourceStorage.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/storage/EventBusResourceStorage.java @@ -10,6 +10,7 @@ import io.vertx.core.json.JsonObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.HttpRequest; /** @@ -20,10 +21,12 @@ public class EventBusResourceStorage implements ResourceStorage { private static final Logger log = LoggerFactory.getLogger(EventBusResourceStorage.class); private final EventBus eventBus; private final String address; + private final GateleenExceptionFactory exceptionFactory; - public EventBusResourceStorage(EventBus eventBus, String address) { + public EventBusResourceStorage(EventBus eventBus, String address, GateleenExceptionFactory exceptionFactory) { this.eventBus = eventBus; this.address = address; + this.exceptionFactory = exceptionFactory; } @Override @@ -34,9 +37,9 @@ public void get(String uri, final Handler bodyHandler) { eventBus.request(address, request, (Handler>>) message -> { if (message.failed()) { - log.warn("Got failed msg from event bus while GET. Lets run into NPE now.", new Exception("stacktrace", message.cause())); - // Would be best to stop processing now. But we don't to keep backward - // compatibility (Will run into NPE anyway). + log.warn("stacktrace", exceptionFactory.newException( + "eventBus.request('" + address + "', request) failed", message.cause())); + return; } Buffer buffer = message.result().body(); int headerLength = buffer.getInt(0); @@ -58,10 +61,9 @@ public void put(String uri, MultiMap headers, Buffer buffer, final Handler>>) message -> { if (message.failed()) { - log.warn("Got failed msg from event bus while PUT. Lets run into NPE now.", - new Exception("stacktrace", message.cause())); - // Would be best to stop processing now. But we don't to keep backward - // compatibility (Will run into NPE anyway). + log.warn("stacktrace", exceptionFactory.newException( + "eventBus.request('" + address + "', request) failed", message.cause())); + return; } Buffer buffer1 = message.result().body(); int headerLength = buffer1.getInt(0); @@ -82,10 +84,9 @@ public void delete(String uri, final Handler doneHandler) { request.setInt(0, header.length()).appendBuffer(header); eventBus.request(address, request, (Handler>>) message -> { if (message.failed()) { - log.warn("Got failed msg from event bus while DELETE. Lets run into NPE now.", - new Exception("stacktrace", message.cause())); - // Would be best to stop processing now. But we don't to keep backward - // compatibility (Will run into NPE anyway). + log.warn("stacktrace", exceptionFactory.newException( + "eventBus.request('" + address + "', request) failed", message.cause())); + return; } Buffer buffer = message.result().body(); int headerLength = buffer.getInt(0); diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/storage/HttpResourceStorage.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/storage/HttpResourceStorage.java index 3a5ba74a..511d7338 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/storage/HttpResourceStorage.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/storage/HttpResourceStorage.java @@ -7,9 +7,12 @@ import io.vertx.core.http.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.util.HttpHeaderUtil; import org.swisspush.gateleen.core.util.StatusCode; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenThriftyExceptionFactory; + /** * Gives programmatic access to the resource storage. * @@ -17,19 +20,26 @@ */ public class HttpResourceStorage implements ResourceStorage { + private final GateleenExceptionFactory exceptionFactory; + private HttpClient client; private String host; private int port; - private HttpClient client; private Logger log = LoggerFactory.getLogger(HttpResourceStorage.class); private static final long TIMEOUT = 30000; public HttpResourceStorage(Vertx vertx) { - this(vertx, "localhost", 8989); + this(vertx, newGateleenThriftyExceptionFactory(), "localhost", 8989); } - public HttpResourceStorage(Vertx vertx, String host, int port) { + public HttpResourceStorage( + Vertx vertx, + GateleenExceptionFactory exceptionFactory, + String host, + int port + ) { + this.exceptionFactory = exceptionFactory; this.host = host; this.port = port; this.client = vertx.createHttpClient(new HttpClientOptions() @@ -46,20 +56,20 @@ public void get(final String path, final Handler bodyHandler) { log.debug("Reading {}", path); client.request(HttpMethod.GET, path).onComplete(asyncResult -> { if (asyncResult.failed()) { - log.warn("Failed request to {}", path, new Exception("stacktrace", asyncResult.cause())); + log.warn("Failed request to {}", path, exceptionFactory.newException(asyncResult.cause())); return; } HttpClientRequest request = asyncResult.result(); - request.exceptionHandler(e -> { - log.error("Storage request error", new Exception("stacktrace", e)); + request.exceptionHandler(ex -> { + log.error("Storage request error", exceptionFactory.newException(ex)); bodyHandler.handle(null); }); request.idleTimeout(TIMEOUT); request.send(event -> { HttpClientResponse response = event.result(); - response.exceptionHandler(exception -> { - log.error("Reading {} failed", path, new Exception("stacktrace", exception)); + response.exceptionHandler(ex -> { + log.error("Reading {} failed", path, exceptionFactory.newException(ex)); bodyHandler.handle(null); }); if (response.statusCode() == StatusCode.OK.getStatusCode()) { @@ -85,7 +95,7 @@ public int getPort() { public void put(final String uri, MultiMap headers, Buffer buffer, final Handler doneHandler) { client.request(HttpMethod.PUT, uri).onComplete(asyncResult -> { if (asyncResult.failed()) { - log.warn("Failed request to {}", uri, new Exception("stacktrace", asyncResult.cause())); + log.warn("Failed request to {}", uri, exceptionFactory.newException(asyncResult.cause())); return; } HttpClientRequest request = asyncResult.result(); @@ -104,13 +114,13 @@ public void put(final String uri, MultiMap headers, Buffer buffer, final Handler request.putHeader("Content-Length", "" + buffer.length()); request.write(buffer); request.send(asyncRespnose -> { - if( asyncRespnose.failed() ){ - log.error("TODO error handling", new Exception(request.getURI(), asyncRespnose.cause())); + if (asyncRespnose.failed()) { + log.error("TODO error handling", exceptionFactory.newException(request.getURI(), asyncRespnose.cause())); return; } HttpClientResponse response = asyncRespnose.result(); response.exceptionHandler( ex -> { - log.error("Exception on response to PUT {}", uri, new Exception("stacktrace", ex)); + log.error("Exception on response to PUT {}", uri, exceptionFactory.newException(ex)); doneHandler.handle(StatusCode.INTERNAL_SERVER_ERROR.getStatusCode()); }); response.endHandler(nothing -> doneHandler.handle(response.statusCode())); @@ -127,24 +137,26 @@ public void put(final String uri, final Buffer buffer, final Handler do public void delete(final String uri, final Handler doneHandler) { client.request(HttpMethod.DELETE, uri).onComplete(asyncResult -> { if (asyncResult.failed()) { - log.warn("Failed request to {}", uri, new Exception("stacktrace", asyncResult.cause())); + log.warn("Failed request to {}", uri, exceptionFactory.newException(asyncResult.cause())); return; } HttpClientRequest request = asyncResult.result(); request.exceptionHandler( ex -> { - log.warn("Deleting {} failed", uri, new Exception("stacktrace", ex)); + log.warn("Deleting {} failed", uri, exceptionFactory.newException(ex)); doneHandler.handle(StatusCode.INTERNAL_SERVER_ERROR.getStatusCode()); }); request.idleTimeout(TIMEOUT); request.send(asyncRespnose -> { if( asyncRespnose.failed() ){ - log.error("TODO error handling", new Exception(request.getURI(), asyncRespnose.cause())); + log.error("TODO error handling", exceptionFactory.newException( + request.getURI(), asyncRespnose.cause())); return; } HttpClientResponse response = asyncRespnose.result(); - response.exceptionHandler(exception -> { - log.error("Exception on response to DELETE from {}", uri, new Exception("stacktrace", exception)); + response.exceptionHandler(ex -> { + log.error("Exception on response to DELETE from {}", uri, + exceptionFactory.newException(ex)); doneHandler.handle(StatusCode.INTERNAL_SERVER_ERROR.getStatusCode()); }); response.endHandler(event -> doneHandler.handle(response.statusCode())); diff --git a/gateleen-core/src/main/java/org/swisspush/gateleen/core/util/LockUtil.java b/gateleen-core/src/main/java/org/swisspush/gateleen/core/util/LockUtil.java index 40b0093a..705e03d2 100644 --- a/gateleen-core/src/main/java/org/swisspush/gateleen/core/util/LockUtil.java +++ b/gateleen-core/src/main/java/org/swisspush/gateleen/core/util/LockUtil.java @@ -3,6 +3,7 @@ import io.vertx.core.Future; import io.vertx.core.Promise; import org.slf4j.Logger; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.lock.Lock; /** @@ -12,7 +13,11 @@ */ public class LockUtil { - private LockUtil(){} + private final GateleenExceptionFactory exceptionFactory; + + public LockUtil(GateleenExceptionFactory exceptionFactory) { + this.exceptionFactory = exceptionFactory; + } /** * Acquire a lock. Resolves always to Boolean.TRUE when no lock implementation is provided @@ -58,7 +63,7 @@ public static Future acquireLock(Lock lockImpl, String lock, String tok * @param token the unique token * @param log the Logger */ - public static void releaseLock(Lock lockImpl, String lock, String token, Logger log){ + public void releaseLock(Lock lockImpl, String lock, String token, Logger log){ if(lockImpl == null){ log.info("No lock implementation defined, going to pretend like we released the lock"); return; @@ -70,7 +75,8 @@ public static void releaseLock(Lock lockImpl, String lock, String token, Logger log.debug("Released lock '{}' with token '{}'", lock, token); } } else { - log.error("Could not release lock '{}'.", lock, new Exception("stacktrace", releaseEvent.cause())); + log.error("Could not release lock '{}'.", lock, + exceptionFactory.newException(releaseEvent.cause())); } }); } diff --git a/gateleen-core/src/test/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManagerTest.java b/gateleen-core/src/test/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManagerTest.java index 57edbcca..4f28f807 100644 --- a/gateleen-core/src/test/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManagerTest.java +++ b/gateleen-core/src/test/java/org/swisspush/gateleen/core/configuration/ConfigurationResourceManagerTest.java @@ -20,6 +20,7 @@ import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.*; import static org.swisspush.gateleen.core.configuration.ConfigurationResourceManager.CONFIG_RESOURCE_CHANGED_ADDRESS; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; /** * Tests for the {@link ConfigurationResourceManager} class @@ -35,7 +36,7 @@ public class ConfigurationResourceManagerTest extends ConfigurationResourceTestB public void testGetRegisteredResourceNotYetRegistered(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -53,7 +54,7 @@ public void testGetRegisteredResourceNotYetRegistered(TestContext context) { public void testGetRegisteredResource(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -68,8 +69,7 @@ public void testGetRegisteredResource(TestContext context) { // resource should not be in storage context.assertFalse(storage.getMockData().containsKey(resourceURI)); - - boolean handled = configurationResourceManager.handleConfigurationResource(request); +boolean handled = configurationResourceManager.handleConfigurationResource(request); context.assertTrue(handled, "PUT Request to configuration resource should be handled"); // resource should be in storage @@ -87,7 +87,7 @@ public void testGetRegisteredResource(TestContext context) { public void testGetRegisteredResourceInitiallyLoadedFromStorage(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -118,7 +118,7 @@ public void testGetRegisteredResourceInitiallyLoadedFromStorage(TestContext cont public void testGetRegisteredResourceInitiallyLoadedFromStorageInvalid(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -148,7 +148,7 @@ public void testGetRegisteredResourceInitiallyLoadedFromStorageInvalid(TestConte public void testRegistrationAndValidUpdateWithSchema(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -178,7 +178,7 @@ public void testRegistrationAndValidUpdateWithSchema(TestContext context) { public void testRegistrationAndInvalidUpdateWithSchema(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -212,7 +212,7 @@ public void testNoNotificationAfterUnsuccessfulStoragePut(TestContext context) t int storagePutFailStatusCode = 400; storage.failPutWith(storagePutFailStatusCode); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -247,7 +247,7 @@ public void testNoNotificationAfterUnsuccessfulStoragePut(TestContext context) t public void testNotSupportedConfigurationResourceChangeType(TestContext context) { Async async = context.async(); MockResourceStorage storage = Mockito.spy(new MockResourceStorage()); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -274,7 +274,7 @@ public void testNotSupportedConfigurationResourceChangeType(TestContext context) public void testRequestWithoutUri(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -297,7 +297,7 @@ public void testRequestWithoutUri(TestContext context) { public void testGETRequestToRegisteredResourceUriShouldNotBeHandled(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -320,7 +320,7 @@ public void testGETRequestToRegisteredResourceUriShouldNotBeHandled(TestContext public void testNotificationAfterRegistration(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; storage.putMockData(resourceURI, CONTENT_MATCHING_PERSON_SCHEMA); @@ -348,7 +348,7 @@ public void testNotificationAfterRegistration(TestContext context) { public void testNotificationMultipleObserversAfterRegistration(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; storage.putMockData(resourceURI, CONTENT_MATCHING_PERSON_SCHEMA); @@ -379,7 +379,7 @@ public void testNotificationMultipleObserversAfterRegistration(TestContext conte public void testRemoveResource(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -420,7 +420,7 @@ public void testNoNotificationWhenRemovingNotExistingResource(TestContext contex Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); String resourceURI = "/gateleen/resources/person"; @@ -467,7 +467,7 @@ public void testNoNotificationWhenRemovingNotExistingResource(TestContext contex public void testRequestToNotRegisteredResourceUriShouldNotBeHandled(TestContext context) { Async async = context.async(); MockResourceStorage storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, newGateleenWastefulExceptionFactory()); configurationResourceManager.registerResource("/gateleen/resources/person/abc", PERSON_SCHEMA); configurationResourceManager.registerResource("/gateleen/resources/person/def", PERSON_SCHEMA); diff --git a/gateleen-core/src/test/java/org/swisspush/gateleen/core/resource/CopyResourceHandlerTest.java b/gateleen-core/src/test/java/org/swisspush/gateleen/core/resource/CopyResourceHandlerTest.java index c8530c1a..7574a5c0 100644 --- a/gateleen-core/src/test/java/org/swisspush/gateleen/core/resource/CopyResourceHandlerTest.java +++ b/gateleen-core/src/test/java/org/swisspush/gateleen/core/resource/CopyResourceHandlerTest.java @@ -12,6 +12,8 @@ import org.junit.runner.RunWith; import org.mockito.Mockito; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; + @RunWith(VertxUnitRunner.class) public class CopyResourceHandlerTest { private HttpServerRequest httpServerRequestMock; @@ -20,7 +22,7 @@ public class CopyResourceHandlerTest { @Before public void init() { httpServerRequestMock = Mockito.mock(HttpServerRequest.class); - copyResourceHandler = new CopyResourceHandler(Mockito.mock(HttpClient.class), null); + copyResourceHandler = new CopyResourceHandler(Mockito.mock(HttpClient.class), newGateleenWastefulExceptionFactory(), null); MultiMap headers = MultiMap.caseInsensitiveMultiMap().add("x-expire-after", "700"); Mockito.doReturn(headers).when(httpServerRequestMock).headers(); @@ -83,4 +85,4 @@ public void testApplyHeadersFailed() { Assert.assertNull(copyTask); } -} \ No newline at end of file +} diff --git a/gateleen-core/src/test/java/org/swisspush/gateleen/core/util/LockUtilTest.java b/gateleen-core/src/test/java/org/swisspush/gateleen/core/util/LockUtilTest.java index 68f2d5dc..bb059875 100644 --- a/gateleen-core/src/test/java/org/swisspush/gateleen/core/util/LockUtilTest.java +++ b/gateleen-core/src/test/java/org/swisspush/gateleen/core/util/LockUtilTest.java @@ -12,6 +12,7 @@ import org.swisspush.gateleen.core.lock.Lock; import static org.mockito.ArgumentMatchers.*; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; /** * Tests for the {@link LockUtil} class @@ -23,11 +24,13 @@ public class LockUtilTest { private Lock lock; private Logger log; + private LockUtil lockUtil; @Before public void setUp(){ lock = Mockito.mock(Lock.class); log = Mockito.mock(Logger.class); + lockUtil = new LockUtil(newGateleenWastefulExceptionFactory()); } @Test @@ -79,14 +82,14 @@ public void testAcquireLockError(TestContext context) { @Test public void testReleaseLockWithoutLockImplementationDefined(TestContext context) { - LockUtil.releaseLock(null, "someLock", "someToken", log); + lockUtil.releaseLock(null, "someLock", "someToken", log); Mockito.verify(log, Mockito.timeout(100).times(1)).info(eq("No lock implementation defined, going to pretend like we released the lock")); } @Test public void testReleaseLockSuccess(TestContext context) { Mockito.when(lock.releaseLock(anyString(), anyString())).thenReturn(Future.succeededFuture(Boolean.TRUE)); - LockUtil.releaseLock(lock, "someLock", "someToken", log); + lockUtil.releaseLock(lock, "someLock", "someToken", log); Mockito.verify(log, Mockito.times(1)).debug(eq("Trying to release lock '{}' with token '{}'"), eq("someLock"), eq("someToken")); Mockito.verify(log, Mockito.times(1)).debug(eq("Released lock '{}' with token '{}'"), eq("someLock"), eq("someToken")); } @@ -94,14 +97,14 @@ public void testReleaseLockSuccess(TestContext context) { @Test public void testReleaseLockFail(TestContext context) { Mockito.when(lock.releaseLock(anyString(), anyString())).thenReturn(Future.succeededFuture(Boolean.FALSE)); - LockUtil.releaseLock(lock, "someLock", "someToken", log); + lockUtil.releaseLock(lock, "someLock", "someToken", log); Mockito.verify(log, Mockito.times(1)).debug(eq("Trying to release lock '{}' with token '{}'"), eq("someLock"), eq("someToken")); } @Test public void testReleaseLockError(TestContext context) { Mockito.when(lock.releaseLock(anyString(), anyString())).thenReturn(Future.failedFuture("Booom")); - LockUtil.releaseLock(lock, "someLock", "someToken", log); + lockUtil.releaseLock(lock, "someLock", "someToken", log); Mockito.verify(log, Mockito.times(1)).debug(eq("Trying to release lock '{}' with token '{}'"), eq("someLock"), eq("someToken")); Mockito.verify(log, Mockito.times(1)).error(eq("Could not release lock '{}'."), eq("someLock"), isA(Throwable.class)); } diff --git a/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateTest.java b/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateTest.java index f0033649..2f157082 100644 --- a/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateTest.java +++ b/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateTest.java @@ -16,6 +16,7 @@ import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.ClientRequestCreator; import org.swisspush.gateleen.core.http.DummyHttpServerRequest; import org.swisspush.gateleen.core.http.LocalHttpClient; @@ -25,6 +26,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; import static org.swisspush.gateleen.core.util.ResourcesUtils.loadResource; /** @@ -39,6 +41,7 @@ public class DelegateTest { private final String VALID_DYNAMIC_HEADERS_DELEGATE = loadResource("valid_dynamic_headers_delegate", true); private final String VALID_HEADER_DEFINITON_DELEGATE = loadResource("valid_header_definition_delegate", true); + private final GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private String delegatesSchema = loadResource("gateleen_delegate_schema_delegates", true); private ClientRequestCreator clientRequestCreator; @@ -48,7 +51,7 @@ public class DelegateTest { public void setUp() { Vertx vertx = Mockito.mock(Vertx.class); Mockito.when(vertx.eventBus()).thenReturn(Mockito.mock(EventBus.class)); - final LocalHttpClient selfClient = new LocalHttpClient(vertx); + final LocalHttpClient selfClient = new LocalHttpClient(vertx, exceptionFactory); selfClient.setRoutingContexttHandler(event -> {}); clientRequestCreator = Mockito.spy(new ClientRequestCreator(selfClient)); delegateFactory = new DelegateFactory(clientRequestCreator, new HashMap<>(), delegatesSchema); diff --git a/gateleen-hook/src/main/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManager.java b/gateleen-hook/src/main/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManager.java index 7ee16d9a..849123f8 100644 --- a/gateleen-hook/src/main/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManager.java +++ b/gateleen-hook/src/main/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManager.java @@ -8,10 +8,12 @@ import io.vertx.redis.client.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.HttpRequest; import org.swisspush.gateleen.core.lock.Lock; import org.swisspush.gateleen.core.util.Address; import org.swisspush.gateleen.core.util.HttpRequestHeader; +import org.swisspush.gateleen.core.util.LockUtil; import org.swisspush.gateleen.core.util.StringUtils; import org.swisspush.gateleen.queue.queuing.RequestQueue; @@ -21,7 +23,6 @@ import static org.swisspush.gateleen.core.util.HttpRequestHeader.CONTENT_LENGTH; import static org.swisspush.gateleen.core.util.LockUtil.acquireLock; -import static org.swisspush.gateleen.core.util.LockUtil.releaseLock; import static org.swisspush.redisques.util.RedisquesAPI.*; /** @@ -36,6 +37,7 @@ public class ReducedPropagationManager { private final ReducedPropagationStorage storage; private final RequestQueue requestQueue; private Lock lock; + private final LockUtil lockUtil; public static final String PROCESS_EXPIRED_QUEUES_LOCK = "reducedPropagationProcExpQueuesLock"; public static final String LOCK_REQUESTER = "ReducedPropagationManager"; public static final String PROCESSOR_ADDRESS = "gateleen.hook-expired-queues-processor"; @@ -50,11 +52,18 @@ public class ReducedPropagationManager { private Logger log = LoggerFactory.getLogger(ReducedPropagationManager.class); - public ReducedPropagationManager(Vertx vertx, ReducedPropagationStorage storage, RequestQueue requestQueue, Lock lock) { + public ReducedPropagationManager( + Vertx vertx, + ReducedPropagationStorage storage, + RequestQueue requestQueue, + Lock lock, + GateleenExceptionFactory exceptionFactory + ) { this.vertx = vertx; this.storage = storage; this.requestQueue = requestQueue; this.lock = lock; + this.lockUtil = new LockUtil(exceptionFactory); registerExpiredQueueProcessor(); } @@ -157,7 +166,7 @@ private void processExpiredQueues(String lockToken) { storage.removeExpiredQueues(System.currentTimeMillis()).onComplete(event -> { if (event.failed()) { log.error("Going to release lock because process expired queues failed. Cause: " + event.cause()); - releaseLock(this.lock, PROCESS_EXPIRED_QUEUES_LOCK, lockToken, log); + lockUtil.releaseLock(this.lock, PROCESS_EXPIRED_QUEUES_LOCK, lockToken, log); return; } Response response = event.result(); diff --git a/gateleen-hook/src/main/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorage.java b/gateleen-hook/src/main/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorage.java index cd1a34cc..2e008ce3 100644 --- a/gateleen-hook/src/main/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorage.java +++ b/gateleen-hook/src/main/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorage.java @@ -8,6 +8,7 @@ import io.vertx.redis.client.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.lua.LuaScriptState; import org.swisspush.gateleen.core.redis.RedisProvider; import org.swisspush.gateleen.core.util.StringUtils; @@ -36,11 +37,11 @@ public class RedisReducedPropagationStorage implements ReducedPropagationStorage private LuaScriptState startQueueTimerLuaScriptState; private LuaScriptState removeExpiredQueuesRedisCommand; - public RedisReducedPropagationStorage(RedisProvider redisProvider) { + public RedisReducedPropagationStorage(RedisProvider redisProvider, GateleenExceptionFactory exceptionFactory) { this.redisProvider = redisProvider; - startQueueTimerLuaScriptState = new LuaScriptState(ReducedPropagationLuaScripts.START_QUEUE_TIMER, redisProvider, false); - removeExpiredQueuesRedisCommand = new LuaScriptState(ReducedPropagationLuaScripts.REMOVE_EXPIRED_QUEUES, redisProvider, false); + startQueueTimerLuaScriptState = new LuaScriptState(ReducedPropagationLuaScripts.START_QUEUE_TIMER, redisProvider, exceptionFactory, false); + removeExpiredQueuesRedisCommand = new LuaScriptState(ReducedPropagationLuaScripts.REMOVE_EXPIRED_QUEUES, redisProvider, exceptionFactory, false); } @Override diff --git a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManagerTest.java b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManagerTest.java index 57acaf17..099770d2 100644 --- a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManagerTest.java +++ b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/ReducedPropagationManagerTest.java @@ -17,6 +17,7 @@ import org.mockito.ArgumentCaptor; import org.mockito.InOrder; import org.mockito.Mockito; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.HttpRequest; import org.swisspush.gateleen.core.lock.Lock; import org.swisspush.gateleen.queue.queuing.RequestQueue; @@ -25,6 +26,7 @@ import java.util.List; import static org.mockito.Mockito.*; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; import static org.swisspush.gateleen.core.util.HttpRequestHeader.CONTENT_LENGTH; import static org.swisspush.gateleen.core.util.HttpRequestHeader.getInteger; import static org.swisspush.gateleen.hook.reducedpropagation.ReducedPropagationManager.*; @@ -42,6 +44,7 @@ public class ReducedPropagationManagerTest { public Timeout rule = Timeout.seconds(50); private Vertx vertx; + private final GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private ReducedPropagationStorage reducedPropagationStorage; private ReducedPropagationManager manager; private RequestQueue requestQueue; @@ -55,7 +58,7 @@ public void setUp() { requestQueue = Mockito.mock(RequestQueue.class); requestQueueInOrder = Mockito.inOrder(requestQueue); lock = Mockito.mock(Lock.class); - manager = new ReducedPropagationManager(vertx, reducedPropagationStorage, requestQueue, lock); + manager = new ReducedPropagationManager(vertx, reducedPropagationStorage, requestQueue, lock, exceptionFactory); } @Test diff --git a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageAddQueueMultipleQueuesTest.java b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageAddQueueMultipleQueuesTest.java index c744e2a8..a0bc3e91 100644 --- a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageAddQueueMultipleQueuesTest.java +++ b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageAddQueueMultipleQueuesTest.java @@ -16,6 +16,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import redis.clients.jedis.Jedis; import redis.clients.jedis.Tuple; import redis.clients.jedis.exceptions.JedisConnectionException; @@ -25,6 +26,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; import static org.swisspush.gateleen.hook.reducedpropagation.impl.RedisReducedPropagationStorage.QUEUE_TIMERS; /** @@ -40,6 +42,7 @@ public class RedisReducedPropagationStorageAddQueueMultipleQueuesTest { private static Vertx vertx; + private static final GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private Jedis jedis; private static RedisReducedPropagationStorage storage; @@ -51,7 +54,7 @@ public static void setupStorage() { vertx = Vertx.vertx(); RedisAPI redisAPI = RedisAPI.api(new RedisClient(vertx, new NetClientOptions(), new PoolOptions(), new RedisStandaloneConnectOptions(), TracingPolicy.IGNORE)); - storage = new RedisReducedPropagationStorage(() -> Future.succeededFuture(redisAPI)); + storage = new RedisReducedPropagationStorage(() -> Future.succeededFuture(redisAPI), exceptionFactory); } @Before diff --git a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageRemoveExpiredQueuesEmptyTest.java b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageRemoveExpiredQueuesEmptyTest.java index 2274cfee..60c2a557 100644 --- a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageRemoveExpiredQueuesEmptyTest.java +++ b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageRemoveExpiredQueuesEmptyTest.java @@ -17,11 +17,13 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import redis.clients.jedis.Jedis; import redis.clients.jedis.exceptions.JedisConnectionException; import java.util.Collections; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; import static org.swisspush.gateleen.hook.reducedpropagation.impl.RedisReducedPropagationStorage.QUEUE_TIMERS; /** @@ -38,6 +40,7 @@ public class RedisReducedPropagationStorageRemoveExpiredQueuesEmptyTest { private static Vertx vertx; + private static final GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private Jedis jedis; private static RedisReducedPropagationStorage storage; @@ -49,7 +52,7 @@ public static void setupStorage() { vertx = Vertx.vertx(); RedisAPI redisAPI = RedisAPI.api(new RedisClient(vertx, new NetClientOptions(), new PoolOptions(), new RedisStandaloneConnectOptions(), TracingPolicy.IGNORE)); - storage = new RedisReducedPropagationStorage(() -> Future.succeededFuture(redisAPI)); + storage = new RedisReducedPropagationStorage(() -> Future.succeededFuture(redisAPI), exceptionFactory); } @Before diff --git a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageTest.java b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageTest.java index a4c42c5d..5adec353 100644 --- a/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageTest.java +++ b/gateleen-hook/src/test/java/org/swisspush/gateleen/hook/reducedpropagation/impl/RedisReducedPropagationStorageTest.java @@ -18,6 +18,7 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import redis.clients.jedis.Jedis; import redis.clients.jedis.Tuple; import redis.clients.jedis.exceptions.JedisConnectionException; @@ -28,6 +29,7 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; import static org.swisspush.gateleen.hook.reducedpropagation.impl.RedisReducedPropagationStorage.QUEUE_REQUESTS; import static org.swisspush.gateleen.hook.reducedpropagation.impl.RedisReducedPropagationStorage.QUEUE_TIMERS; @@ -40,6 +42,7 @@ public class RedisReducedPropagationStorageTest { private static Vertx vertx; + private static final GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private Jedis jedis; private static RedisReducedPropagationStorage storage; @@ -51,7 +54,7 @@ public static void setupStorage() { vertx = Vertx.vertx(); RedisAPI redisAPI = RedisAPI.api(new RedisClient(vertx, new NetClientOptions(), new PoolOptions(), new RedisStandaloneConnectOptions(), TracingPolicy.IGNORE)); - storage = new RedisReducedPropagationStorage(() -> Future.succeededFuture(redisAPI)); + storage = new RedisReducedPropagationStorage(() -> Future.succeededFuture(redisAPI), exceptionFactory); } @Before diff --git a/gateleen-kafka/src/test/java/org/swisspush/gateleen/kafka/KafkaHandlerTest.java b/gateleen-kafka/src/test/java/org/swisspush/gateleen/kafka/KafkaHandlerTest.java index 05435036..8ed8cca7 100644 --- a/gateleen-kafka/src/test/java/org/swisspush/gateleen/kafka/KafkaHandlerTest.java +++ b/gateleen-kafka/src/test/java/org/swisspush/gateleen/kafka/KafkaHandlerTest.java @@ -17,6 +17,7 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.swisspush.gateleen.core.configuration.ConfigurationResourceManager; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.storage.MockResourceStorage; import org.swisspush.gateleen.core.util.ResourcesUtils; import org.swisspush.gateleen.core.util.StatusCode; @@ -34,6 +35,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; import static org.swisspush.gateleen.core.configuration.ConfigurationResourceManager.CONFIG_RESOURCE_CHANGED_ADDRESS; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; /** * Test class for the {@link KafkaHandler} @@ -50,6 +52,7 @@ public class KafkaHandlerTest { private ConfigurationResourceManager configurationResourceManager; private KafkaHandler handler; private MockResourceStorage storage; + private GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private final String configResourceUri = "/kafka/topicsConfig"; private final String streamingPath = "/kafka/streaming/"; @@ -64,7 +67,7 @@ public void setUp() { kafkaMessageSender = Mockito.mock(KafkaMessageSender.class); messageValidator = Mockito.mock(KafkaMessageValidator.class); storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, exceptionFactory); handler = new KafkaHandler(configurationResourceManager, repository, kafkaMessageSender, configResourceUri, streamingPath); diff --git a/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java b/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java index 212dd866..816e8f25 100755 --- a/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java +++ b/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java @@ -26,6 +26,7 @@ import org.swisspush.gateleen.core.configuration.ConfigurationResourceManager; import org.swisspush.gateleen.core.cors.CORSHandler; import org.swisspush.gateleen.core.event.EventBusHandler; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.ClientRequestCreator; import org.swisspush.gateleen.core.http.LocalHttpClient; import org.swisspush.gateleen.core.lock.Lock; @@ -121,6 +122,7 @@ public class Server extends AbstractVerticle { private ResourceStorage storage; private CacheStorage cacheStorage; private CacheDataFetcher cacheDataFetcher; + private final GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private Authorizer authorizer; private Router router; @@ -168,7 +170,7 @@ public static void main(String[] args) { @Override public void start() { - final LocalHttpClient selfClient = new LocalHttpClient(vertx); + final LocalHttpClient selfClient = new LocalHttpClient(vertx, exceptionFactory); final JsonObject info = new JsonObject(); final Map props = RunConfig.buildRedisProps("localhost", defaultRedisPort); @@ -206,26 +208,26 @@ public void start() { RedisProvider redisProvider = () -> Future.succeededFuture(redisApi); new CustomRedisMonitor(vertx, redisProvider, "main", "rest-storage", 10).start(); - storage = new EventBusResourceStorage(vertx.eventBus(), Address.storageAddress() + "-main"); + storage = new EventBusResourceStorage(vertx.eventBus(), Address.storageAddress() + "-main", exceptionFactory); corsHandler = new CORSHandler(); RuleProvider ruleProvider = new RuleProvider(vertx, RULES_ROOT, storage, props); deltaHandler = new DeltaHandler(redisProvider, selfClient, ruleProvider, true); expansionHandler = new ExpansionHandler(ruleProvider, selfClient, props, ROOT); - copyResourceHandler = new CopyResourceHandler(selfClient, SERVER_ROOT + "/v1/copy"); + copyResourceHandler = new CopyResourceHandler(selfClient, exceptionFactory, SERVER_ROOT + "/v1/copy"); monitoringHandler = new MonitoringHandler(vertx, storage, PREFIX, SERVER_ROOT + "/monitoring/rpr"); Lock lock = new RedisBasedLock(redisProvider, newGateleenWastefulExceptionFactory()); - cacheStorage = new RedisCacheStorage(vertx, lock, redisProvider, 20 * 1000); + cacheStorage = new RedisCacheStorage(vertx, lock, redisProvider, exceptionFactory, 20 * 1000); cacheDataFetcher = new DefaultCacheDataFetcher(new ClientRequestCreator(selfClient)); cacheHandler = new CacheHandler(cacheDataFetcher, cacheStorage, SERVER_ROOT + "/cache"); qosHandler = new QoSHandler(vertx, storage, SERVER_ROOT + "/admin/v1/qos", props, PREFIX); qosHandler.enableResourceLogging(true); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, exceptionFactory); configurationResourceManager.enableResourceLogging(true); eventBusHandler = new EventBusHandler(vertx, SERVER_ROOT + "/event/v1/", @@ -255,8 +257,8 @@ public void start() { roleProfileHandler.enableResourceLogging(true); QueueClient queueClient = new QueueClient(vertx, monitoringHandler); - reducedPropagationManager = new ReducedPropagationManager(vertx, new RedisReducedPropagationStorage(redisProvider), - queueClient, lock); + reducedPropagationManager = new ReducedPropagationManager(vertx, new RedisReducedPropagationStorage(redisProvider, exceptionFactory), + queueClient, lock, exceptionFactory); reducedPropagationManager.startExpiredQueueProcessing(5000); queueSplitter = new QueueSplitterImpl(configurationResourceManager, SERVER_ROOT + "/admin/v1/queueSplitters"); @@ -321,12 +323,12 @@ public void start() { queueCircuitBreakerConfigurationResourceManager = new QueueCircuitBreakerConfigurationResourceManager(vertx, storage, SERVER_ROOT + "/admin/v1/circuitbreaker"); queueCircuitBreakerConfigurationResourceManager.enableResourceLogging(true); - QueueCircuitBreakerStorage queueCircuitBreakerStorage = new RedisQueueCircuitBreakerStorage(redisProvider); + QueueCircuitBreakerStorage queueCircuitBreakerStorage = new RedisQueueCircuitBreakerStorage(redisProvider, exceptionFactory); QueueCircuitBreakerHttpRequestHandler requestHandler = new QueueCircuitBreakerHttpRequestHandler(vertx, queueCircuitBreakerStorage, SERVER_ROOT + "/queuecircuitbreaker/circuit"); QueueCircuitBreaker queueCircuitBreaker = new QueueCircuitBreakerImpl(vertx, lock, - Address.redisquesAddress(), queueCircuitBreakerStorage, ruleProvider, rulePatternToCircuitMapping, + Address.redisquesAddress(), queueCircuitBreakerStorage, ruleProvider, exceptionFactory, rulePatternToCircuitMapping, queueCircuitBreakerConfigurationResourceManager, requestHandler, circuitBreakerPort); new QueueProcessor(vertx, selfClient, monitoringHandler, queueCircuitBreaker); diff --git a/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/QueueProcessor.java b/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/QueueProcessor.java index 1ebb50c4..bd3f040d 100755 --- a/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/QueueProcessor.java +++ b/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/QueueProcessor.java @@ -13,6 +13,7 @@ import io.vertx.core.json.JsonObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.HttpRequest; import org.swisspush.gateleen.core.http.RequestLoggerFactory; import org.swisspush.gateleen.core.util.Address; @@ -23,6 +24,7 @@ import org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueCircuitState; import org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueResponseType; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenThriftyExceptionFactory; import static org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueResponseType.FAILURE; import static org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueResponseType.SUCCESS; import static org.swisspush.redisques.util.RedisquesAPI.*; @@ -36,6 +38,7 @@ public class QueueProcessor { private HttpClient httpClient; private MonitoringHandler monitoringHandler; private QueueCircuitBreaker queueCircuitBreaker; + private final GateleenExceptionFactory exceptionFactory; private static final Handler DEV_NULL = buf -> {}; private MessageConsumer consumer; @@ -46,15 +49,22 @@ public QueueProcessor(final Vertx vertx, final HttpClient httpClient, final Moni } public QueueProcessor(final Vertx vertx, final HttpClient httpClient, final MonitoringHandler monitoringHandler, QueueCircuitBreaker queueCircuitBreaker) { - this(vertx, httpClient, monitoringHandler, queueCircuitBreaker, true); + this(vertx, httpClient, monitoringHandler, queueCircuitBreaker, newGateleenThriftyExceptionFactory(), true); } - public QueueProcessor(final Vertx vertx, final HttpClient httpClient, final MonitoringHandler monitoringHandler, - QueueCircuitBreaker queueCircuitBreaker, boolean immediatelyStartQueueProcessing) { + public QueueProcessor( + Vertx vertx, + HttpClient httpClient, + MonitoringHandler monitoringHandler, + QueueCircuitBreaker queueCircuitBreaker, + GateleenExceptionFactory exceptionFactory, + boolean immediatelyStartQueueProcessing + ) { this.vertx = vertx; this.httpClient = httpClient; this.monitoringHandler = monitoringHandler; this.queueCircuitBreaker = queueCircuitBreaker; + this.exceptionFactory = exceptionFactory; if (immediatelyStartQueueProcessing) { startQueueProcessing(); @@ -245,7 +255,8 @@ private void executeQueuedRequest(Message message, Logger logger, Ht Handler> httpAsyncHandler = asyncResult -> { if (asyncResult.failed()) { - logger.error("TODO error handling", new Exception("stacktrace", asyncResult.cause())); + logger.error("TODO error handling", exceptionFactory.newException( + "httpClientRequest.send() failed", asyncResult.cause())); return; } HttpClientResponse response = asyncResult.result(); diff --git a/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImpl.java b/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImpl.java index eb26a211..fbd883d4 100644 --- a/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImpl.java +++ b/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImpl.java @@ -8,10 +8,12 @@ import io.vertx.redis.client.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.HttpRequest; import org.swisspush.gateleen.core.lock.Lock; import org.swisspush.gateleen.core.refresh.Refreshable; import org.swisspush.gateleen.core.util.Address; +import org.swisspush.gateleen.core.util.LockUtil; import org.swisspush.gateleen.queue.queuing.circuitbreaker.QueueCircuitBreaker; import org.swisspush.gateleen.queue.queuing.circuitbreaker.QueueCircuitBreakerStorage; import org.swisspush.gateleen.queue.queuing.circuitbreaker.configuration.QueueCircuitBreakerConfigurationResource; @@ -26,7 +28,6 @@ import java.util.concurrent.atomic.AtomicInteger; import static org.swisspush.gateleen.core.util.LockUtil.acquireLock; -import static org.swisspush.gateleen.core.util.LockUtil.releaseLock; import static org.swisspush.redisques.util.RedisquesAPI.*; @@ -43,6 +44,7 @@ public class QueueCircuitBreakerImpl implements QueueCircuitBreaker, RuleChanges private final QueueCircuitBreakerConfigurationResourceManager configResourceManager; private final Lock lock; + private final LockUtil lockUtil; public static final String OPEN_TO_HALF_OPEN_TASK_LOCK = "openToHalfOpenTask"; public static final String UNLOCK_QUEUES_TASK_LOCK = "unlockQueuesTask"; @@ -67,9 +69,21 @@ public class QueueCircuitBreakerImpl implements QueueCircuitBreaker, RuleChanges * @param queueCircuitBreakerHttpRequestHandler request handler * @param requestHandlerPort the port to listen to */ - public QueueCircuitBreakerImpl(Vertx vertx, Lock lock, String redisquesAddress, QueueCircuitBreakerStorage queueCircuitBreakerStorage, RuleProvider ruleProvider, QueueCircuitBreakerRulePatternToCircuitMapping ruleToCircuitMapping, QueueCircuitBreakerConfigurationResourceManager configResourceManager, Handler queueCircuitBreakerHttpRequestHandler, int requestHandlerPort) { + public QueueCircuitBreakerImpl( + Vertx vertx, + Lock lock, + String redisquesAddress, + QueueCircuitBreakerStorage queueCircuitBreakerStorage, + RuleProvider ruleProvider, + GateleenExceptionFactory exceptionFactory, + QueueCircuitBreakerRulePatternToCircuitMapping ruleToCircuitMapping, + QueueCircuitBreakerConfigurationResourceManager configResourceManager, + Handler queueCircuitBreakerHttpRequestHandler, + int requestHandlerPort + ) { this.vertx = vertx; this.lock = lock; + this.lockUtil = new LockUtil(exceptionFactory); this.redisquesAddress = redisquesAddress; this.queueCircuitBreakerStorage = queueCircuitBreakerStorage; ruleProvider.registerObserver(this); @@ -130,7 +144,7 @@ private void registerOpenToHalfOpenTask() { } } else { log.error(event1.cause().getMessage()); - releaseLock(this.lock, OPEN_TO_HALF_OPEN_TASK_LOCK, token, log); + lockUtil.releaseLock(this.lock, OPEN_TO_HALF_OPEN_TASK_LOCK, token, log); } }); } @@ -165,7 +179,7 @@ private void registerUnlockQueuesTask() { } } else { log.error("Unable to unlock queue '{}'", event1.cause().getMessage()); - releaseLock(this.lock, UNLOCK_QUEUES_TASK_LOCK, token, log); + lockUtil.releaseLock(this.lock, UNLOCK_QUEUES_TASK_LOCK, token, log); } }); } @@ -199,7 +213,7 @@ private void registerUnlockSampleQueuesTask() { } } else { log.error(event1.cause().getMessage()); - releaseLock(this.lock, UNLOCK_SAMPLE_QUEUES_TASK_LOCK, token, log); + lockUtil.releaseLock(this.lock, UNLOCK_SAMPLE_QUEUES_TASK_LOCK, token, log); } }); } diff --git a/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/RedisQueueCircuitBreakerStorage.java b/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/RedisQueueCircuitBreakerStorage.java index 49ac4900..1746916f 100644 --- a/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/RedisQueueCircuitBreakerStorage.java +++ b/gateleen-queue/src/main/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/RedisQueueCircuitBreakerStorage.java @@ -7,6 +7,7 @@ import io.vertx.redis.client.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.lua.LuaScriptState; import org.swisspush.gateleen.core.redis.RedisProvider; import org.swisspush.gateleen.core.util.StringUtils; @@ -47,15 +48,15 @@ public class RedisQueueCircuitBreakerStorage implements QueueCircuitBreakerStora private final LuaScriptState unlockSampleQueuesLuaScriptState; private final LuaScriptState getAllCircuitsLuaScriptState; - public RedisQueueCircuitBreakerStorage(RedisProvider redisProvider) { + public RedisQueueCircuitBreakerStorage(RedisProvider redisProvider, GateleenExceptionFactory exceptionFactory) { this.redisProvider = redisProvider; - openCircuitLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.UPDATE_CIRCUIT, redisProvider, false); - closeCircuitLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.CLOSE_CIRCUIT, redisProvider, false); - reOpenCircuitLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.REOPEN_CIRCUIT, redisProvider, false); - halfOpenCircuitLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.HALFOPEN_CIRCUITS, redisProvider, false); - unlockSampleQueuesLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.UNLOCK_SAMPLES, redisProvider, false); - getAllCircuitsLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.ALL_CIRCUITS, redisProvider, false); + openCircuitLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.UPDATE_CIRCUIT, redisProvider, exceptionFactory, false); + closeCircuitLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.CLOSE_CIRCUIT, redisProvider, exceptionFactory, false); + reOpenCircuitLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.REOPEN_CIRCUIT, redisProvider, exceptionFactory, false); + halfOpenCircuitLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.HALFOPEN_CIRCUITS, redisProvider, exceptionFactory, false); + unlockSampleQueuesLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.UNLOCK_SAMPLES, redisProvider, exceptionFactory, false); + getAllCircuitsLuaScriptState = new LuaScriptState(QueueCircuitBreakerLuaScripts.ALL_CIRCUITS, redisProvider, exceptionFactory, false); } @Override diff --git a/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/QueueProcessorTest.java b/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/QueueProcessorTest.java index 14889478..c05d9d3e 100644 --- a/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/QueueProcessorTest.java +++ b/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/QueueProcessorTest.java @@ -21,6 +21,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.FastFaiHttpClientResponse; import org.swisspush.gateleen.core.http.HttpRequest; import org.swisspush.gateleen.core.http.LocalHttpClientRequest; @@ -34,6 +35,7 @@ import org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueResponseType; import static org.mockito.Mockito.*; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; /** * Tests for the {@link QueueProcessor} class @@ -45,6 +47,7 @@ public class QueueProcessorTest { private Vertx vertx; private HttpClient httpClient; private MonitoringHandler monitoringHandler; + private final GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private String PAYLOAD = "{\"method\":\"PUT\",\"uri\":\"/playground/server/tests/exp/item_2\",\"headers\":[],\"payload\":\"eyJrZXkiOiAidmFsdWUifQ==\"}"; private final String QUEUE_RETRY_400 = ResourcesUtils.loadResource("testresource_queue_retry_400", true); @@ -68,10 +71,10 @@ public void testQueueProcessorStartStopQueueProcessing(TestContext context) { QueueProcessor queueProcessor = new QueueProcessor(vertx, httpClient, monitoringHandler); context.assertTrue(queueProcessor.isQueueProcessingStarted()); - queueProcessor = new QueueProcessor(vertx, httpClient, monitoringHandler, null, true); + queueProcessor = new QueueProcessor(vertx, httpClient, monitoringHandler, null, exceptionFactory, true); context.assertTrue(queueProcessor.isQueueProcessingStarted()); - queueProcessor = new QueueProcessor(vertx, httpClient, monitoringHandler, null, false); + queueProcessor = new QueueProcessor(vertx, httpClient, monitoringHandler, null, exceptionFactory, false); context.assertFalse(queueProcessor.isQueueProcessingStarted()); queueProcessor.startQueueProcessing(); @@ -214,7 +217,7 @@ private void setHttpClientRespondStatusCode(StatusCode statusCode) { String url = (String) invocation.getArguments()[1]; LocalHttpClientRequest request = new LocalHttpClientRequest(httpMethod, url, vertx, event -> { - }, new LocalHttpServerResponse(vertx)) { + }, exceptionFactory, new LocalHttpServerResponse(vertx)) { @Override public HttpClientRequest response(Handler> handler) { FastFaiHttpClientResponse response = new FastFaiHttpClientResponse() { diff --git a/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImplTest.java b/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImplTest.java index 21a31c52..d6dcb991 100644 --- a/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImplTest.java +++ b/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/QueueCircuitBreakerImplTest.java @@ -37,6 +37,7 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.*; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; import static org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueResponseType.SUCCESS; /** @@ -88,9 +89,10 @@ public void setUp() { config.setUnlockSampleQueuesTaskInterval(1000); Mockito.when(configResourceManager.getConfigurationResource()).thenReturn(config); + var exceptionFactory = newGateleenWastefulExceptionFactory(); Handler queueCircuitBreakerHttpRequestHandler = Mockito.mock(Handler.class); queueCircuitBreaker = Mockito.spy(new QueueCircuitBreakerImpl(vertx, lock, Address.redisquesAddress(), queueCircuitBreakerStorage, ruleProvider, - ruleToCircuitMapping, configResourceManager, queueCircuitBreakerHttpRequestHandler, 9999)); + exceptionFactory, ruleToCircuitMapping, configResourceManager, queueCircuitBreakerHttpRequestHandler, 9999)); } @After diff --git a/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/RedisQueueCircuitBreakerStorageTest.java b/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/RedisQueueCircuitBreakerStorageTest.java index 6f12c286..22145d71 100644 --- a/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/RedisQueueCircuitBreakerStorageTest.java +++ b/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/circuitbreaker/impl/RedisQueueCircuitBreakerStorageTest.java @@ -18,6 +18,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.queue.queuing.circuitbreaker.util.PatternAndCircuitHash; import org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueCircuitState; import org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueResponseType; @@ -28,6 +29,7 @@ import java.util.*; import java.util.regex.Pattern; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; import static org.swisspush.gateleen.queue.queuing.circuitbreaker.impl.RedisQueueCircuitBreakerStorage.*; import static org.swisspush.gateleen.queue.queuing.circuitbreaker.util.QueueCircuitState.*; @@ -50,7 +52,7 @@ public class RedisQueueCircuitBreakerStorageTest { public static void setupStorage(){ vertx = Vertx.vertx(); RedisAPI redisAPI = RedisAPI.api(new RedisClient(vertx, new NetClientOptions(), new PoolOptions(), new RedisStandaloneConnectOptions(), TracingPolicy.IGNORE)); - storage = new RedisQueueCircuitBreakerStorage(() -> Future.succeededFuture(redisAPI)); + storage = new RedisQueueCircuitBreakerStorage(() -> Future.succeededFuture(redisAPI), newGateleenWastefulExceptionFactory()); } @Before diff --git a/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/splitter/QueueSplitterImplTest.java b/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/splitter/QueueSplitterImplTest.java index 2fa996c4..0678fa2f 100644 --- a/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/splitter/QueueSplitterImplTest.java +++ b/gateleen-queue/src/test/java/org/swisspush/gateleen/queue/queuing/splitter/QueueSplitterImplTest.java @@ -13,18 +13,21 @@ import org.junit.runner.RunWith; import org.swisspush.gateleen.core.configuration.ConfigurationResourceManager; import org.swisspush.gateleen.core.configuration.ConfigurationResourceObserver; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.storage.MockResourceStorage; import org.swisspush.gateleen.core.util.ResourcesUtils; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.swisspush.gateleen.core.configuration.ConfigurationResourceManager.CONFIG_RESOURCE_CHANGED_ADDRESS; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; @RunWith(VertxUnitRunner.class) public class QueueSplitterImplTest { private Vertx vertx; private MockResourceStorage storage; + private final GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private final String configResourceUri = "/queueSplitters"; private ConfigurationResourceManager configurationResourceManager; private QueueSplitterImpl queueSplitter; @@ -37,7 +40,7 @@ public class QueueSplitterImplTest { public void setUp() { vertx = Vertx.vertx(); storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + configurationResourceManager = new ConfigurationResourceManager(vertx, storage, exceptionFactory); queueSplitter = new QueueSplitterImpl(configurationResourceManager, configResourceUri); } diff --git a/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java b/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java index 7cbf35ba..65ab5a30 100755 --- a/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java +++ b/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java @@ -8,6 +8,7 @@ import org.quartz.CronExpression; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.HttpRequest; import org.swisspush.gateleen.core.redis.RedisProvider; import org.swisspush.gateleen.monitoring.MonitoringHandler; @@ -32,6 +33,7 @@ public class Scheduler { private final Vertx vertx; private final RedisProvider redisProvider; + private final GateleenExceptionFactory exceptionFactory; private final String redisquesAddress; private final String name; private CronExpression cronExpression; @@ -45,12 +47,23 @@ public class Scheduler { private Logger log; - public Scheduler(Vertx vertx, String redisquesAddress, RedisProvider redisProvider, String name, String cronExpression, - List requests, MonitoringHandler monitoringHandler, int maxRandomOffset, - boolean executeOnStartup, boolean executeOnReload) throws ParseException { + public Scheduler( + Vertx vertx, + String redisquesAddress, + RedisProvider redisProvider, + GateleenExceptionFactory exceptionFactory, + String name, + String cronExpression, + List requests, + MonitoringHandler monitoringHandler, + int maxRandomOffset, + boolean executeOnStartup, + boolean executeOnReload + ) throws ParseException { this.vertx = vertx; this.redisquesAddress = redisquesAddress; this.redisProvider = redisProvider; + this.exceptionFactory = exceptionFactory; this.name = name; this.cronExpression = new CronExpression(cronExpression); this.requests = requests; @@ -141,7 +154,10 @@ private void trigger() { JsonObject enqueOp = buildEnqueueOperation(queueName, request.toJsonObject().put(QueueClient.QUEUE_TIMESTAMP, System.currentTimeMillis()).encode()); vertx.eventBus().request(redisquesAddress, enqueOp, (Handler>>) event -> { if (event.failed()) { - if (log.isWarnEnabled()) log.warn("Could not enqueue request '{}' '{}'", queueName, request.getUri(), new Exception(event.cause())); + if (log.isWarnEnabled()) { + log.warn("Could not enqueue request '{}' '{}'", queueName, request.getUri(), + exceptionFactory.newException("eventBus.request('" + redisquesAddress + "', enqueOp) failed", event.cause())); + } return; } if (!OK.equals(event.result().body().getString(STATUS))) { diff --git a/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/SchedulerFactory.java b/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/SchedulerFactory.java index 5de530d2..1a5c34f3 100755 --- a/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/SchedulerFactory.java +++ b/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/SchedulerFactory.java @@ -6,6 +6,7 @@ import io.vertx.core.json.JsonObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.HttpRequest; import org.swisspush.gateleen.core.redis.RedisProvider; import org.swisspush.gateleen.core.util.StringUtils; @@ -40,19 +41,28 @@ public class SchedulerFactory { private final JsonArray defaultRequestHeaders; private final Vertx vertx; private final RedisProvider redisProvider; + private final GateleenExceptionFactory exceptionFactory; private final MonitoringHandler monitoringHandler; private final String schedulersSchema; private final String redisquesAddress; private final Logger log = LoggerFactory.getLogger(SchedulerFactory.class); - public SchedulerFactory(Map properties, Map defaultRequestHeaders, Vertx vertx, - RedisProvider redisProvider, MonitoringHandler monitoringHandler, String schedulersSchema, - String redisquesAddress) { + public SchedulerFactory( + Map properties, + Map defaultRequestHeaders, + Vertx vertx, + RedisProvider redisProvider, + GateleenExceptionFactory exceptionFactory, + MonitoringHandler monitoringHandler, + String schedulersSchema, + String redisquesAddress + ) { this.properties = properties; this.defaultRequestHeaders = defaultRequestHeadersAsJsonArray(defaultRequestHeaders); this.vertx = vertx; this.redisProvider = redisProvider; + this.exceptionFactory = exceptionFactory; this.monitoringHandler = monitoringHandler; this.schedulersSchema = schedulersSchema; this.redisquesAddress = redisquesAddress; @@ -122,7 +132,7 @@ public List parseSchedulers(Buffer buffer) throws ValidationException } } try { - result.add(new Scheduler(vertx, redisquesAddress, redisProvider, entry.getKey(), + result.add(new Scheduler(vertx, redisquesAddress, redisProvider, exceptionFactory, entry.getKey(), (String) schedulerJson.get("cronExpression"), requests, monitoringHandler, maxRandomOffset, executeOnStartup, executeOnReload) ); } catch (ParseException e) { diff --git a/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/SchedulerResourceManager.java b/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/SchedulerResourceManager.java index 59b6d1eb..da8bbbe1 100755 --- a/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/SchedulerResourceManager.java +++ b/gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/SchedulerResourceManager.java @@ -8,6 +8,7 @@ import io.vertx.core.http.HttpServerRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.logging.LoggableResource; import org.swisspush.gateleen.core.logging.RequestLogger; import org.swisspush.gateleen.core.redis.RedisProvider; @@ -24,6 +25,8 @@ import java.util.List; import java.util.Map; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenThriftyExceptionFactory; + /** * @author https://github.com/lbovet [Laurent Bovet] */ @@ -53,12 +56,20 @@ public SchedulerResourceManager(Vertx vertx, RedisProvider redisProvider, final public SchedulerResourceManager(Vertx vertx, RedisProvider redisProvider, final ResourceStorage storage, MonitoringHandler monitoringHandler, String schedulersUri, Map props, String redisquesAddress) { - this(vertx, redisProvider, storage, monitoringHandler, schedulersUri, props, redisquesAddress, Collections.emptyMap()); + this(vertx, redisProvider, newGateleenThriftyExceptionFactory(), storage, monitoringHandler, schedulersUri, props, redisquesAddress, Collections.emptyMap()); } - public SchedulerResourceManager(Vertx vertx, RedisProvider redisProvider, final ResourceStorage storage, - MonitoringHandler monitoringHandler, String schedulersUri, Map props, - String redisquesAddress, Map defaultRequestHeaders) { + public SchedulerResourceManager( + Vertx vertx, + RedisProvider redisProvider, + GateleenExceptionFactory exceptionFactory, + ResourceStorage storage, + MonitoringHandler monitoringHandler, + String schedulersUri, + Map props, + String redisquesAddress, + Map defaultRequestHeaders + ) { this.vertx = vertx; this.storage = storage; this.schedulersUri = schedulersUri; @@ -66,7 +77,7 @@ public SchedulerResourceManager(Vertx vertx, RedisProvider redisProvider, final this.schedulersSchema = ResourcesUtils.loadResource("gateleen_scheduler_schema_schedulers", true); this.schedulerFactory = new SchedulerFactory(properties, defaultRequestHeaders, vertx, redisProvider, - monitoringHandler, schedulersSchema, redisquesAddress); + exceptionFactory, monitoringHandler, schedulersSchema, redisquesAddress); updateSchedulers(); diff --git a/gateleen-scheduler/src/test/java/org/swisspush/gateleen/scheduler/SchedulerFactoryTest.java b/gateleen-scheduler/src/test/java/org/swisspush/gateleen/scheduler/SchedulerFactoryTest.java index 037c7ed6..13f7a3e6 100755 --- a/gateleen-scheduler/src/test/java/org/swisspush/gateleen/scheduler/SchedulerFactoryTest.java +++ b/gateleen-scheduler/src/test/java/org/swisspush/gateleen/scheduler/SchedulerFactoryTest.java @@ -14,6 +14,7 @@ import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.mockito.Mockito; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.HttpRequest; import org.swisspush.gateleen.core.redis.RedisProvider; import org.swisspush.gateleen.core.util.Address; @@ -25,6 +26,7 @@ import java.util.List; import static org.mockito.Mockito.when; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; /** * Tests for the {@link SchedulerFactory} class @@ -39,6 +41,7 @@ public class SchedulerFactoryTest { private RedisAPI redisAPI; private RedisProvider redisProvider; + private GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); private SchedulerFactory schedulerFactory; @Rule @@ -62,8 +65,8 @@ public void setUp() { monitoringHandler = Mockito.mock(MonitoringHandler.class); - schedulerFactory = new SchedulerFactory(null, Collections.emptyMap(), vertx, redisProvider, monitoringHandler, - schedulersSchema, Address.redisquesAddress()); + schedulerFactory = new SchedulerFactory(null, Collections.emptyMap(), vertx, redisProvider, exceptionFactory, + monitoringHandler, schedulersSchema, Address.redisquesAddress()); } @Test @@ -105,7 +108,7 @@ public void testValidSchedulerConfig(TestContext context) throws ValidationExcep @Test public void testValidSchedulerConfigWithDefaultHeaders(TestContext context) throws ValidationException { schedulerFactory = new SchedulerFactory(null, Collections.singletonMap("x-foo", "zzz"), vertx, redisProvider, - monitoringHandler, schedulersSchema, Address.redisquesAddress()); + exceptionFactory, monitoringHandler, schedulersSchema, Address.redisquesAddress()); List schedulers = schedulerFactory.parseSchedulers(Buffer.buffer(VALID_SCHEDULER_RESOURCE)); context.assertNotNull(schedulers); context.assertEquals(4, schedulers.size()); diff --git a/gateleen-security/src/test/java/org/swisspush/gateleen/security/content/ContentTypeConstraintHandlerTest.java b/gateleen-security/src/test/java/org/swisspush/gateleen/security/content/ContentTypeConstraintHandlerTest.java index 3648b5b5..76f70353 100644 --- a/gateleen-security/src/test/java/org/swisspush/gateleen/security/content/ContentTypeConstraintHandlerTest.java +++ b/gateleen-security/src/test/java/org/swisspush/gateleen/security/content/ContentTypeConstraintHandlerTest.java @@ -27,6 +27,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; /** * Test class for the {@link ContentTypeConstraintHandler} @@ -49,7 +50,7 @@ public class ContentTypeConstraintHandlerTest extends ContentTypeConstraintTestB @Before public void setUp() { storage = new MockResourceStorage(); - configurationResourceManager = new ConfigurationResourceManager(Vertx.vertx(), storage); + configurationResourceManager = new ConfigurationResourceManager(Vertx.vertx(), storage, newGateleenWastefulExceptionFactory()); repository = Mockito.spy(new ContentTypeConstraintRepository()); handler = new ContentTypeConstraintHandler(configurationResourceManager, repository, configResourceUri); } diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java index dd04f701..64741b9a 100755 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java @@ -30,6 +30,7 @@ import org.swisspush.gateleen.core.configuration.ConfigurationResourceManager; import org.swisspush.gateleen.core.cors.CORSHandler; import org.swisspush.gateleen.core.event.EventBusHandler; +import org.swisspush.gateleen.core.exception.GateleenExceptionFactory; import org.swisspush.gateleen.core.http.ClientRequestCreator; import org.swisspush.gateleen.core.http.LocalHttpClient; import org.swisspush.gateleen.core.lock.Lock; @@ -119,6 +120,7 @@ public abstract class AbstractTest { protected static PropertyHandler propertyHandler; protected static Jedis jedis; private static HttpServer mainServer; + private static final GateleenExceptionFactory exceptionFactory = newGateleenWastefulExceptionFactory(); protected final static Map props = new HashMap<>(); protected static SchedulerResourceManager schedulerResourceManager; protected static HookHandler hookHandler; @@ -137,7 +139,7 @@ public static void setupBeforeClass(TestContext context) { jedis.flushAll(); final JsonObject info = new JsonObject(); - final LocalHttpClient selfClient = new LocalHttpClient(vertx); + final LocalHttpClient selfClient = new LocalHttpClient(vertx, exceptionFactory); props.putAll(RunConfig.buildRedisProps("localhost", REDIS_PORT)); String redisHost = (String) props.get("redis.host"); @@ -154,9 +156,9 @@ public static void setupBeforeClass(TestContext context) { RedisAPI redisAPI = RedisAPI.api(redisClient); RedisProvider redisProvider = () -> Future.succeededFuture(redisAPI); - ResourceStorage storage = new EventBusResourceStorage(vertx.eventBus(), Address.storageAddress() + "-main"); + ResourceStorage storage = new EventBusResourceStorage(vertx.eventBus(), Address.storageAddress() + "-main", exceptionFactory); MonitoringHandler monitoringHandler = new MonitoringHandler(vertx, storage, PREFIX); - ConfigurationResourceManager configurationResourceManager = new ConfigurationResourceManager(vertx, storage); + ConfigurationResourceManager configurationResourceManager = new ConfigurationResourceManager(vertx, storage, exceptionFactory); String eventBusConfigurationResource = SERVER_ROOT + "/admin/v1/hookconfig"; EventBusHandler eventBusHandler = new EventBusHandler(vertx, SERVER_ROOT + "/event/v1/", @@ -176,7 +178,7 @@ public static void setupBeforeClass(TestContext context) { QueueClient queueClient = new QueueClient(vertx, monitoringHandler); ReducedPropagationManager reducedPropagationManager = new ReducedPropagationManager(vertx, - new RedisReducedPropagationStorage(redisProvider), queueClient, lock); + new RedisReducedPropagationStorage(redisProvider, exceptionFactory), queueClient, lock, exceptionFactory); reducedPropagationManager.startExpiredQueueProcessing(1000); hookHandler = new HookHandler(vertx, selfClient, storage, loggingResourceManager, logAppenderRepository, monitoringHandler, SERVER_ROOT + "/users/v1/%s/profile", ROOT + "/server/hooks/v1/", @@ -195,7 +197,7 @@ public static void setupBeforeClass(TestContext context) { cacheHandler = new CacheHandler( new DefaultCacheDataFetcher(new ClientRequestCreator(selfClient)), - new RedisCacheStorage(vertx, lock, redisProvider, 60000), + new RedisCacheStorage(vertx, lock, redisProvider, exceptionFactory, 60000), SERVER_ROOT + "/cache"); customHttpResponseHandler = new CustomHttpResponseHandler(RETURN_HTTP_STATUS_ROOT); @@ -207,13 +209,14 @@ public static void setupBeforeClass(TestContext context) { QueueCircuitBreakerConfigurationResourceManager queueCircuitBreakerConfigurationResourceManager = new QueueCircuitBreakerConfigurationResourceManager(vertx, storage, SERVER_ROOT + "/admin/v1/circuitbreaker"); - QueueCircuitBreakerStorage queueCircuitBreakerStorage = new RedisQueueCircuitBreakerStorage(redisProvider); + QueueCircuitBreakerStorage queueCircuitBreakerStorage = new RedisQueueCircuitBreakerStorage(redisProvider, exceptionFactory); QueueCircuitBreakerHttpRequestHandler requestHandler = new QueueCircuitBreakerHttpRequestHandler(vertx, queueCircuitBreakerStorage,SERVER_ROOT + "/queuecircuitbreaker/circuit"); QueueCircuitBreaker queueCircuitBreaker = new QueueCircuitBreakerImpl(vertx, lock, - Address.redisquesAddress(), queueCircuitBreakerStorage, ruleProvider, rulePatternToCircuitMapping, - queueCircuitBreakerConfigurationResourceManager, requestHandler, CIRCUIT_BREAKER_REST_API_PORT); + Address.redisquesAddress(), queueCircuitBreakerStorage, ruleProvider, exceptionFactory, + rulePatternToCircuitMapping, queueCircuitBreakerConfigurationResourceManager, requestHandler, + CIRCUIT_BREAKER_REST_API_PORT); new QueueProcessor(vertx, selfClient, monitoringHandler, queueCircuitBreaker); final QueueBrowser queueBrowser = new QueueBrowser(vertx, SERVER_ROOT + "/queuing", @@ -250,7 +253,7 @@ public static void setupBeforeClass(TestContext context) { .expansionHandler(new ExpansionHandler(vertx, storage, selfClient, props, ROOT, RULES_ROOT)) .hookHandler(hookHandler) .qosHandler(qosHandler) - .copyResourceHandler(new CopyResourceHandler(selfClient, SERVER_ROOT + "/v1/copy")) + .copyResourceHandler(new CopyResourceHandler(selfClient, exceptionFactory, SERVER_ROOT + "/v1/copy")) .eventBusHandler(eventBusHandler) .roleProfileHandler(roleProfileHandler) .userProfileHandler(userProfileHandler) diff --git a/gateleen-validation/src/test/java/org/swisspush/gateleen/validation/DefaultValidationSchemaProviderTest.java b/gateleen-validation/src/test/java/org/swisspush/gateleen/validation/DefaultValidationSchemaProviderTest.java index 8a22a201..5fe61455 100644 --- a/gateleen-validation/src/test/java/org/swisspush/gateleen/validation/DefaultValidationSchemaProviderTest.java +++ b/gateleen-validation/src/test/java/org/swisspush/gateleen/validation/DefaultValidationSchemaProviderTest.java @@ -21,6 +21,7 @@ import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import static org.swisspush.gateleen.core.exception.GateleenExceptionFactory.newGateleenWastefulExceptionFactory; @RunWith(VertxUnitRunner.class) public class DefaultValidationSchemaProviderTest { @@ -32,7 +33,7 @@ public class DefaultValidationSchemaProviderTest { @Before public void setUp(){ vertx = Vertx.vertx(); - final LocalHttpClient selfClient = new LocalHttpClient(vertx); + final LocalHttpClient selfClient = new LocalHttpClient(vertx, newGateleenWastefulExceptionFactory()); selfClient.setRoutingContexttHandler(event -> {}); clientRequestCreator = Mockito.spy(new ClientRequestCreator(selfClient)); schemaProvider = new DefaultValidationSchemaProvider(vertx, clientRequestCreator, Duration.ofSeconds(5)); From adb2a63dd6571c5c848b5bbaac918251e63ef159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Weber?= Date: Fri, 24 May 2024 11:11:08 +0200 Subject: [PATCH 21/22] #576 Implement unmatched delegate handling --- gateleen-delegate/README_delegate.md | 4 + .../swisspush/gateleen/delegate/Delegate.java | 18 +++- .../gateleen/delegate/DelegateFactory.java | 11 ++- .../gateleen/delegate/DelegateHandler.java | 27 ++++-- .../delegate/DelegateFactoryTest.java | 2 +- ...eHandler.java => DelegateHandlerTest.java} | 48 ++++++++++- .../gateleen/delegate/DelegateTest.java | 85 ++++++++++++++++++- .../resources/valid_delegate_not_matching | 14 +++ .../swisspush/gateleen/playground/Server.java | 2 +- .../org/swisspush/gateleen/AbstractTest.java | 4 +- 10 files changed, 194 insertions(+), 21 deletions(-) rename gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/{TestDelegateHandler.java => DelegateHandlerTest.java} (60%) create mode 100644 gateleen-delegate/src/test/resources/valid_delegate_not_matching diff --git a/gateleen-delegate/README_delegate.md b/gateleen-delegate/README_delegate.md index 0cfa7493..8601bc92 100644 --- a/gateleen-delegate/README_delegate.md +++ b/gateleen-delegate/README_delegate.md @@ -265,3 +265,7 @@ Also you have to enable the logging on the [DelegateHandler](src/main/java/org/s ```java delegateHandler.enableResourceLogging(true); ``` +### Unmatched delegate handling +The default implementation of _Delegate_ and _DelegateHandler_ end the original request with `200 OK` when the _pattern_ or the _methods_ do not match. + +To override this behaviour, a _StatusCode_ can be provided in the constructor of _DelegateHandler_ as `unmatchedDelegateStatusCode` to define how the original requests should be responded when the called delegate does not match. \ No newline at end of file diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java index 85968aa6..f1aa6cc5 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java @@ -18,6 +18,7 @@ import org.swisspush.gateleen.core.util.HttpServerRequestUtil; import org.swisspush.gateleen.core.util.StatusCode; +import javax.annotation.Nullable; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; @@ -43,6 +44,7 @@ public class Delegate { private final Pattern pattern; private final Set methods; private final List requests; + private final StatusCode unmatchedDelegateStatusCode; private boolean delegateContainsJoltSpecRequest = false; /** @@ -54,12 +56,15 @@ public class Delegate { * @param methods methods of the delegate * @param requests requests of the delegate */ - public Delegate(final ClientRequestCreator clientRequestCreator, final String name, final Pattern pattern, final Set methods, final List requests) { + public Delegate(final ClientRequestCreator clientRequestCreator, final String name, final Pattern pattern, + final Set methods, final List requests, + @Nullable StatusCode unmatchedDelegateStatusCode) { this.clientRequestCreator = clientRequestCreator; this.name = name; this.pattern = pattern; this.methods = methods; this.requests = requests; + this.unmatchedDelegateStatusCode = unmatchedDelegateStatusCode; this.delegateContainsJoltSpecRequest = doesDelegateContainJoltSpecRequest(); } @@ -107,8 +112,15 @@ public void handle(final HttpServerRequest request) { } } - // end response, if nothing matches - request.response().end(); + // when delegate not matched and status code is defined, respond with defined status code + if(unmatchedDelegateStatusCode != null) { + request.response().setStatusCode(unmatchedDelegateStatusCode.getStatusCode()); + request.response().setStatusMessage(unmatchedDelegateStatusCode.getStatusMessage()); + request.response().end(); + } else { + // when delegate not matched and no status code is defined, just end response with 200 OK + request.response().end(); + } } /** diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java index a3c10166..966ac2d5 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java @@ -12,11 +12,13 @@ import org.swisspush.gateleen.core.json.transform.JoltSpec; import org.swisspush.gateleen.core.json.transform.JoltSpecBuilder; import org.swisspush.gateleen.core.json.transform.JoltSpecException; +import org.swisspush.gateleen.core.util.StatusCode; import org.swisspush.gateleen.core.util.StringUtils; import org.swisspush.gateleen.core.validation.ValidationResult; import org.swisspush.gateleen.validation.ValidationException; import org.swisspush.gateleen.validation.Validator; +import javax.annotation.Nullable; import java.util.*; import java.util.regex.Pattern; @@ -40,17 +42,22 @@ public class DelegateFactory { private final Map properties; private final String delegatesSchema; + private final StatusCode unmatchedDelegateStatusCode; + /** * Creates a new instance of the DelegateFactory. * * @param clientRequestCreator * @param properties * @param delegatesSchema + * @param unmatchedDelegateStatusCode */ - public DelegateFactory(final ClientRequestCreator clientRequestCreator, final Map properties, final String delegatesSchema) { + public DelegateFactory(final ClientRequestCreator clientRequestCreator, final Map properties, + final String delegatesSchema, @Nullable StatusCode unmatchedDelegateStatusCode) { this.clientRequestCreator = clientRequestCreator; this.properties = properties; this.delegatesSchema = delegatesSchema; + this.unmatchedDelegateStatusCode = unmatchedDelegateStatusCode; } /** @@ -125,7 +132,7 @@ private Delegate createDelegate(final String delegateName, final String configSt requests.add(new DelegateRequest(requestJsonObject, joltSpec, headerFunction)); } - return new Delegate(clientRequestCreator, delegateName, pattern, methods, requests); + return new Delegate(clientRequestCreator, delegateName, pattern, methods, requests, unmatchedDelegateStatusCode); } private JoltSpec parsePayloadTransformSpec(JsonObject requestJsonObject, String delegateName) throws ValidationException { diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java index c67c4590..9ed410f6 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java @@ -18,9 +18,9 @@ import org.swisspush.gateleen.core.storage.ResourceStorage; import org.swisspush.gateleen.core.util.ResourcesUtils; import org.swisspush.gateleen.core.util.StatusCode; -import org.swisspush.gateleen.monitoring.MonitoringHandler; import org.swisspush.gateleen.validation.ValidationException; +import javax.annotation.Nullable; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; @@ -83,22 +83,37 @@ public class DelegateHandler implements Refreshable, LoggableResource { * @param vertx vertx * @param selfClient selfClient * @param delegateStorage delegateStorage - only used for storing delegates - * @param monitoringHandler monitoringHandler * @param delegatesUri delegate root * @param properties properties * @param doneHandler doneHandler */ public DelegateHandler(final Vertx vertx, final HttpClient selfClient, final ResourceStorage delegateStorage, - final MonitoringHandler monitoringHandler, final String delegatesUri, - final Map properties, - final Handler doneHandler) { + final String delegatesUri, final Map properties, final Handler doneHandler) { + this(vertx, selfClient, delegateStorage, delegatesUri, properties, null, doneHandler); + } + + /** + * Creates a new instance of the DelegateHandler. + * + * @param vertx vertx + * @param selfClient selfClient + * @param delegateStorage delegateStorage - only used for storing delegates + * @param delegatesUri delegate root + * @param properties properties + * @param unmatchedDelegateStatusCode respond requests with this status code when not matched + * @param doneHandler doneHandler + */ + public DelegateHandler(final Vertx vertx, final HttpClient selfClient, final ResourceStorage delegateStorage, + final String delegatesUri, final Map properties, + @Nullable StatusCode unmatchedDelegateStatusCode, final Handler doneHandler) { this.vertx = vertx; this.delegateStorage = delegateStorage; this.delegatesUri = delegatesUri; this.doneHandler = doneHandler; String delegatesSchema = ResourcesUtils.loadResource("gateleen_delegate_schema_delegates", true); - this.delegateFactory = new DelegateFactory(new ClientRequestCreator(selfClient), properties, delegatesSchema); + this.delegateFactory = new DelegateFactory(new ClientRequestCreator(selfClient), properties, + delegatesSchema, unmatchedDelegateStatusCode); delegateNamePattern = Pattern.compile(delegatesUri + "([^/]+)(/" + DEFINITION_RESOURCE + "|/"+ EXECUTION_RESOURCE + ".*" + "|/?)"); diff --git a/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateFactoryTest.java b/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateFactoryTest.java index d6bcb039..91d14699 100644 --- a/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateFactoryTest.java +++ b/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateFactoryTest.java @@ -66,7 +66,7 @@ public void setUp() { Mockito.when(vertx.eventBus()).thenReturn(Mockito.mock(EventBus.class)); Map properties = new HashMap<>(); - delegateFactory = new DelegateFactory(new ClientRequestCreator(Mockito.mock(HttpClient.class)), properties, delegatesSchema); + delegateFactory = new DelegateFactory(new ClientRequestCreator(Mockito.mock(HttpClient.class)), properties, delegatesSchema, null); } @Test diff --git a/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/TestDelegateHandler.java b/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateHandlerTest.java similarity index 60% rename from gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/TestDelegateHandler.java rename to gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateHandlerTest.java index 51e0805f..6f9119c4 100644 --- a/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/TestDelegateHandler.java +++ b/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateHandlerTest.java @@ -1,21 +1,38 @@ package org.swisspush.gateleen.delegate; +import io.vertx.core.http.HttpMethod; +import io.vertx.core.http.HttpServerResponse; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; +import org.mockito.Mockito; +import org.swisspush.gateleen.core.http.DummyHttpServerRequest; + +import static org.mockito.Mockito.verifyNoInteractions; /** - * Tests some features of the DelegateHandler. + * Tests some features of the {@link DelegateHandler}. * * @author https://github.com/ljucam [Mario Ljuca] */ -public class TestDelegateHandler { +public class DelegateHandlerTest { private static final String DELEGATE_URI = "/gateleen/server/delegate/v1/delegates/"; private static DelegateHandler delegateHandler; @BeforeClass public static void init() { - delegateHandler = new DelegateHandler(null, null, null, null, DELEGATE_URI, null, null); + delegateHandler = new DelegateHandler(null, null, null, DELEGATE_URI, + null, null); + } + + @Test + public void testHandle() { + String delegateName = "aName"; + HttpServerResponse response = Mockito.mock(HttpServerResponse.class); + + verifyNoInteractions(response); + Assert.assertFalse(delegateHandler.handle(new CustomHttpServerRequest(DELEGATE_URI + delegateName + "/blah", response))); + Assert.assertFalse(delegateHandler.handle(new CustomHttpServerRequest(DELEGATE_URI + delegateName, response))); } @Test @@ -55,4 +72,29 @@ public void testGetDelegateName_Recognition() { // -------------- } + + private static class CustomHttpServerRequest extends DummyHttpServerRequest { + + private final String uri; + private final HttpServerResponse response; + + public CustomHttpServerRequest(String uri, HttpServerResponse response) { + this.uri = uri; + this.response = response; + } + + @Override public String uri() { + return uri; + } + + @Override public HttpMethod method() { + return HttpMethod.GET; + } + + @Override + public HttpServerResponse response() { + return response != null ? response : super.response(); + } + + } } diff --git a/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateTest.java b/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateTest.java index f0033649..d870ed4b 100644 --- a/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateTest.java +++ b/gateleen-delegate/src/test/java/org/swisspush/gateleen/delegate/DelegateTest.java @@ -1,13 +1,13 @@ package org.swisspush.gateleen.delegate; +import io.vertx.core.Future; import io.vertx.core.Handler; import io.vertx.core.MultiMap; import io.vertx.core.Vertx; import io.vertx.core.buffer.Buffer; import io.vertx.core.eventbus.EventBus; - import io.vertx.core.http.HttpMethod; - +import io.vertx.core.http.HttpServerResponse; import io.vertx.core.http.impl.headers.HeadersMultiMap; import io.vertx.ext.unit.TestContext; import io.vertx.ext.unit.junit.VertxUnitRunner; @@ -19,6 +19,7 @@ import org.swisspush.gateleen.core.http.ClientRequestCreator; import org.swisspush.gateleen.core.http.DummyHttpServerRequest; import org.swisspush.gateleen.core.http.LocalHttpClient; +import org.swisspush.gateleen.core.util.StatusCode; import org.swisspush.gateleen.validation.ValidationException; import java.util.HashMap; @@ -36,9 +37,12 @@ public class DelegateTest { private final String VALID_DELEGATE = loadResource("valid_delegate", true); + private final String VALID_DELEGATE_NOT_MATCHING = loadResource("valid_delegate_not_matching", true); private final String VALID_DYNAMIC_HEADERS_DELEGATE = loadResource("valid_dynamic_headers_delegate", true); private final String VALID_HEADER_DEFINITON_DELEGATE = loadResource("valid_header_definition_delegate", true); + private final String VALID_TRANSFORM_PROPERTY_DELEGATE = loadResource("valid_transform_delegate", true); + private String delegatesSchema = loadResource("gateleen_delegate_schema_delegates", true); private ClientRequestCreator clientRequestCreator; @@ -51,7 +55,64 @@ public void setUp() { final LocalHttpClient selfClient = new LocalHttpClient(vertx); selfClient.setRoutingContexttHandler(event -> {}); clientRequestCreator = Mockito.spy(new ClientRequestCreator(selfClient)); - delegateFactory = new DelegateFactory(clientRequestCreator, new HashMap<>(), delegatesSchema); + delegateFactory = new DelegateFactory(clientRequestCreator, new HashMap<>(), delegatesSchema, null); + } + + @Test + public void testNotMatchingDelegateWithNoDefinedResponseStatusCode(TestContext context) throws ValidationException { + Delegate delegate = delegateFactory.parseDelegate("someDelegate", + Buffer.buffer(VALID_DELEGATE_NOT_MATCHING)); + + HttpServerResponse response = Mockito.mock(HttpServerResponse.class); + + CustomHttpServerRequest request = new CustomHttpServerRequest("/gateleen/playground/foobar", HttpMethod.PUT, + MultiMap.caseInsensitiveMultiMap(), null, response + ); + + delegate.handle(request); + + verifyNoInteractions(clientRequestCreator); + verify(response, never()).setStatusCode(anyInt()); + verify(response, never()).setStatusMessage(anyString()); + verify(response, times(1)).end(); + } + + @Test + public void testNotMatchingDelegateWithDefinedResponseStatusCode(TestContext context) throws ValidationException { + delegateFactory = new DelegateFactory(clientRequestCreator, new HashMap<>(), delegatesSchema, StatusCode.NOT_IMPLEMENTED); + Delegate delegate = delegateFactory.parseDelegate("someDelegate", + Buffer.buffer(VALID_DELEGATE_NOT_MATCHING)); + + HttpServerResponse response = Mockito.mock(HttpServerResponse.class); + + CustomHttpServerRequest request = new CustomHttpServerRequest("/gateleen/playground/foobar", HttpMethod.PUT, + MultiMap.caseInsensitiveMultiMap(),null, response + ); + + delegate.handle(request); + + verifyNoInteractions(clientRequestCreator); + verify(response, times(1)).setStatusCode(eq(StatusCode.NOT_IMPLEMENTED.getStatusCode())); + verify(response, times(1)).setStatusMessage(StatusCode.NOT_IMPLEMENTED.getStatusMessage()); + verify(response, times(1)).end(); + } + + @Test + public void testTransformationWithInvalidOriginalPayload(TestContext context) throws ValidationException { + Delegate delegate = delegateFactory.parseDelegate("someDelegate", + Buffer.buffer(VALID_TRANSFORM_PROPERTY_DELEGATE)); + + HttpServerResponse response = Mockito.mock(HttpServerResponse.class); + CustomHttpServerRequest request = new CustomHttpServerRequest("/gateleen/playground/foobar", HttpMethod.PUT, + MultiMap.caseInsensitiveMultiMap(), Buffer.buffer("{"), response + ); + + delegate.handle(request); + + verifyNoInteractions(clientRequestCreator); + verify(response, times(1)).setStatusCode(eq(StatusCode.BAD_REQUEST.getStatusCode())); + verify(response, times(1)).setStatusMessage(StatusCode.BAD_REQUEST.getStatusMessage()); + verify(response, times(1)).end(startsWith("Unable to parse payload of delegate execution request")); } @Test @@ -151,10 +212,19 @@ private static class CustomHttpServerRequest extends DummyHttpServerRequest { private final HttpMethod method; private final MultiMap headers; + private final HttpServerResponse response; + private final Buffer requestBody; + public CustomHttpServerRequest(String uri, HttpMethod method, MultiMap headers) { + this(uri, method, headers, null, null); + } + + public CustomHttpServerRequest(String uri, HttpMethod method, MultiMap headers, Buffer requestBody, HttpServerResponse response) { this.uri = uri; this.method = method; this.headers = headers; + this.requestBody = requestBody; + this.response = response; } @Override public HttpMethod method() { @@ -165,5 +235,14 @@ public CustomHttpServerRequest(String uri, HttpMethod method, MultiMap headers) } @Override public MultiMap headers() { return headers; } + @Override + public HttpServerResponse response() { + return response != null ? response : super.response(); + } + + @Override + public Future body() { + return requestBody != null ? Future.succeededFuture(requestBody) : super.body(); + } } } diff --git a/gateleen-delegate/src/test/resources/valid_delegate_not_matching b/gateleen-delegate/src/test/resources/valid_delegate_not_matching new file mode 100644 index 00000000..3fec5949 --- /dev/null +++ b/gateleen-delegate/src/test/resources/valid_delegate_not_matching @@ -0,0 +1,14 @@ +{ + "methods": [ "PUT" ], + "pattern": ".*/execution/notmatching/(.*)", + "requests": [ + { + "method": "POST", + "uri": "/gateleen/server/v1/copy", + "payload": { + "source": "/gateleen/$1?expand=100&zip=true", + "destination": "/gateleen/zips/users/$1.zip" + } + } + ] +} \ No newline at end of file diff --git a/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java b/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java index 48bbeb03..558ce541 100755 --- a/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java +++ b/gateleen-playground/src/main/java/org/swisspush/gateleen/playground/Server.java @@ -287,7 +287,7 @@ public void start() { zipExtractHandler = new ZipExtractHandler(selfClient); - delegateHandler = new DelegateHandler(vertx, selfClient, storage, monitoringHandler, + delegateHandler = new DelegateHandler(vertx, selfClient, storage, SERVER_ROOT + "/admin/v1/delegates/", props, null); delegateHandler.enableResourceLogging(true); diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java index c06a011f..cf642f11 100755 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/AbstractTest.java @@ -187,8 +187,8 @@ public static void setupBeforeClass(TestContext context) { LogController logController = new LogController(); logController.registerLogConfiguratorMBean(JMX_DOMAIN); ZipExtractHandler zipExtractHandler = new ZipExtractHandler(selfClient); - DelegateHandler delegateHandler = new DelegateHandler(vertx, selfClient, storage, monitoringHandler, - DELEGATE_ROOT, props, null); + DelegateHandler delegateHandler = new DelegateHandler(vertx, selfClient, storage, DELEGATE_ROOT, + props, null); MergeHandler mergeHandler = new MergeHandler(selfClient); cacheHandler = new CacheHandler( From 02a059a90424e1d0bc27bbcb1174037ac2d0c269 Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Fri, 24 May 2024 17:20:37 +0200 Subject: [PATCH 22/22] Replace NPE by warn log. Related: SDCISA-15833, https://github.com/swisspost/vertx-redisques/issues/170, https://github.com/swisspost/vertx-redisques/pull/177, https://github.com/swisspost/vertx-rest-storage/pull/186, https://github.com/swisspost/gateleen/pull/577 --- .../java/org/swisspush/gateleen/routing/Forwarder.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/Forwarder.java b/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/Forwarder.java index ddc60968..f5485552 100755 --- a/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/Forwarder.java +++ b/gateleen-routing/src/main/java/org/swisspush/gateleen/routing/Forwarder.java @@ -535,7 +535,14 @@ private Handler> getAsyncHttpClientResponseHandl respondError(req, StatusCode.INTERNAL_SERVER_ERROR); }); - req.connection().closeHandler((aVoid) -> unpump.run()); + HttpConnection connection = req.connection(); + if (connection != null) { + connection.closeHandler((Void v) -> unpump.run()); + } else { + log.warn("TODO No way to call 'unpump.run()' in the right moment. As there seems" + + " to be no event we could register a handler for. Gateleen wishes you" + + " some happy timeouts ({})", req.uri()); + } }; }