From e548d5d345603bf0663cc246df15dd836f46637a Mon Sep 17 00:00:00 2001 From: Erik Dahl <89081489+erkdahl@users.noreply.github.com> Date: Mon, 17 Apr 2023 12:47:19 +0200 Subject: [PATCH] =?UTF-8?q?Bounded=20queue-size=20in=20front=20of=20thread?= =?UTF-8?q?pool,=20with=20custom=20rejectPolicy=20t=E2=80=A6=20(#198)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bounded queue-size in front of threadpool, with custom rejectPolicy that will log the event-record when it is discarded. Fixes GH-190 --- .idea/encodings.xml | 2 + .idea/jarRepositories.xml | 10 ++-- .../event/DiscardAndLogOldestPolicy.java | 40 +++++++++++++ .../no/digdir/logging/event/EventLogger.java | 35 ++++-------- .../logging/event/EventLoggingConfig.java | 11 +++- .../no/digdir/logging/event/KafkaTask.java | 45 +++++++++++++++ .../main/resources/event-logger.properties | 3 +- .../event/DiscardAndLogOldestPolicyTest.java | 57 +++++++++++++++++++ .../digdir/logging/event/EventLoggerTest.java | 26 +++++++-- .../logging/event/EventLoggingConfigTest.java | 27 +++++++++ 10 files changed, 222 insertions(+), 34 deletions(-) create mode 100644 log-event/src/main/java/no/digdir/logging/event/DiscardAndLogOldestPolicy.java create mode 100644 log-event/src/main/java/no/digdir/logging/event/KafkaTask.java create mode 100644 log-event/src/test/java/no/digdir/logging/event/DiscardAndLogOldestPolicyTest.java diff --git a/.idea/encodings.xml b/.idea/encodings.xml index ee46050..ec51e76 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -5,5 +5,7 @@ + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml index 70d723c..2a8a088 100644 --- a/.idea/jarRepositories.xml +++ b/.idea/jarRepositories.xml @@ -6,16 +6,16 @@