From 36458e2515957d27f887a78a961f31e506d4c8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Tue, 20 Aug 2024 13:32:50 +0200 Subject: [PATCH] spotless --- .../api/runner/code/AgentCodeAndLoader.java | 16 ++++----- .../agents/PulsarDLQSourceAgentProvider.java | 35 ++++++++++++------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/langstream-api/src/main/java/ai/langstream/api/runner/code/AgentCodeAndLoader.java b/langstream-api/src/main/java/ai/langstream/api/runner/code/AgentCodeAndLoader.java index 5a0b682f0..63ab76be3 100644 --- a/langstream-api/src/main/java/ai/langstream/api/runner/code/AgentCodeAndLoader.java +++ b/langstream-api/src/main/java/ai/langstream/api/runner/code/AgentCodeAndLoader.java @@ -134,8 +134,8 @@ public void start() throws Exception { } @Override - public void close() throws Exception { - executeWithContextClassloader(AgentCode::close); + public void close() { + executeNoExceptionWithContextClassloader(AgentCode::close); } @Override @@ -197,8 +197,8 @@ public void start() throws Exception { } @Override - public void close() throws Exception { - executeWithContextClassloader(AgentCode::close); + public void close() { + executeNoExceptionWithContextClassloader(AgentCode::close); } @Override @@ -259,8 +259,8 @@ public void start() throws Exception { } @Override - public void close() throws Exception { - executeWithContextClassloader(AgentCode::close); + public void close() { + executeNoExceptionWithContextClassloader(AgentCode::close); } @Override @@ -321,8 +321,8 @@ public void join() throws Exception { } @Override - public void close() throws Exception { - executeWithContextClassloader(AgentCode::close); + public void close() { + executeNoExceptionWithContextClassloader(AgentCode::close); } @Override diff --git a/langstream-k8s-runtime/langstream-k8s-runtime-core/src/main/java/ai/langstream/runtime/impl/k8s/agents/PulsarDLQSourceAgentProvider.java b/langstream-k8s-runtime/langstream-k8s-runtime-core/src/main/java/ai/langstream/runtime/impl/k8s/agents/PulsarDLQSourceAgentProvider.java index 542a91028..1a97353d8 100644 --- a/langstream-k8s-runtime/langstream-k8s-runtime-core/src/main/java/ai/langstream/runtime/impl/k8s/agents/PulsarDLQSourceAgentProvider.java +++ b/langstream-k8s-runtime/langstream-k8s-runtime-core/src/main/java/ai/langstream/runtime/impl/k8s/agents/PulsarDLQSourceAgentProvider.java @@ -56,8 +56,8 @@ public static class PulsarDLQSourceConfiguration { @ConfigProperty( description = """ - The URL of the Pulsar cluster to connect to. - """, + The URL of the Pulsar cluster to connect to. + """, defaultValue = "pulsar://localhost:6650", required = false) @JsonProperty("pulsar-url") @@ -66,8 +66,8 @@ public static class PulsarDLQSourceConfiguration { @ConfigProperty( description = """ - Namespace to listen for DLQ topics. - """, + Namespace to listen for DLQ topics. + """, defaultValue = "public/default", required = false) @JsonProperty("namespace") @@ -76,8 +76,8 @@ public static class PulsarDLQSourceConfiguration { @ConfigProperty( description = """ - Subscription name to use for the DLQ topics. - """, + Subscription name to use for the DLQ topics. + """, defaultValue = "langstream-dlq-subscription", required = false) @JsonProperty("subscription") @@ -86,8 +86,8 @@ public static class PulsarDLQSourceConfiguration { @ConfigProperty( description = """ - Suffix to use for DLQ topics. - """, + Suffix to use for DLQ topics. + """, defaultValue = "-DLQ", required = false) @JsonProperty("dlq-suffix") @@ -96,8 +96,8 @@ public static class PulsarDLQSourceConfiguration { @ConfigProperty( description = """ - Include partitioned topics in the DLQ topics. - """, + Include partitioned topics in the DLQ topics. + """, defaultValue = "false") @JsonProperty("include-partitioned") private boolean includePartitioned; @@ -105,11 +105,20 @@ public static class PulsarDLQSourceConfiguration { @ConfigProperty( description = """ - Timeout in milliseconds to wait for messages from the DLQ topics. - Default is 0, meaning it will wait indefinitely. - """, + Timeout in milliseconds to wait for messages from the DLQ topics. + Default is 0, meaning it will wait indefinitely. + """, defaultValue = "0") @JsonProperty("timeout-ms") private int timeoutMs; + + @ConfigProperty( + description = + """ + Pattern auto discovery period in seconds. + """, + defaultValue = "60") + @JsonProperty("pattern-auto-discovery-period-seconds") + private int autoDiscoveryPeriodSeconds; } }