diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterMonitor.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterMonitor.java index 038c189ac..a48206c07 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterMonitor.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterMonitor.java @@ -137,7 +137,9 @@ public void run() { newLimitlessRouters, TimeUnit.MILLISECONDS.toNanos(LimitlessRouterServiceImpl.MONITOR_DISPOSAL_TIME_MS.getLong(props))); - RoundRobinHostSelector.setRoundRobinHostWeightPairsProperty(this.props, newLimitlessRouters); + RoundRobinHostSelector.setRoundRobinHostWeightPairsProperty( + this.pluginService.getProperties(), + newLimitlessRouters); LOGGER.finest(Utils.logTopology(newLimitlessRouters, "[limitlessRouterMonitor] Topology:")); TimeUnit.MILLISECONDS.sleep(this.intervalMs); // do not include this in the telemetry } catch (final InterruptedException exception) { diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterServiceImpl.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterServiceImpl.java index 3404a9b56..6c09f3bd7 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterServiceImpl.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterServiceImpl.java @@ -131,7 +131,9 @@ public void establishConnection(final LimitlessConnectionContext context) throws return; } - RoundRobinHostSelector.setRoundRobinHostWeightPairsProperty(context.getProps(), context.getLimitlessRouters()); + RoundRobinHostSelector.setRoundRobinHostWeightPairsProperty( + this.pluginService.getProperties(), + context.getLimitlessRouters()); HostSpec selectedHostSpec; try { selectedHostSpec = this.pluginService.getHostSpecByStrategy( diff --git a/wrapper/src/test/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterServiceImplTest.java b/wrapper/src/test/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterServiceImplTest.java index a2f85cea8..7a558551b 100644 --- a/wrapper/src/test/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterServiceImplTest.java +++ b/wrapper/src/test/java/software/amazon/jdbc/plugin/limitless/LimitlessRouterServiceImplTest.java @@ -70,6 +70,7 @@ public void init() throws SQLException { props = new Properties(); when(mockConnectFuncLambda.call()).thenReturn(mockConnection); when(mockPluginService.getHostListProvider()).thenReturn(mockHostListProvider); + when(mockPluginService.getProperties()).thenReturn(props); when(mockHostListProvider.getClusterId()).thenReturn(CLUSTER_ID); }