diff --git a/docs/using-the-jdbc-driver/ReaderSelectionStrategies.md b/docs/using-the-jdbc-driver/ReaderSelectionStrategies.md index fe59b170e..97bc41184 100644 --- a/docs/using-the-jdbc-driver/ReaderSelectionStrategies.md +++ b/docs/using-the-jdbc-driver/ReaderSelectionStrategies.md @@ -8,3 +8,5 @@ To balance connections to reader instances more evenly, different selection stra | `roundRobin` | See the following rows for configuration parameters. | The round robin strategy will select a reader instance by taking turns with all available database instances in a cycle. A slight addition to the round robin strategy is the weighted round robin strategy, where more connections will be passed to reader instances based on user specified connection properties. | N/A | | | `roundRobinHostWeightPairs` | This parameter value must be a `string` type comma separated list of database host-weight pairs in the format `:`. The host represents the database instance name, and the weight represents how many connections should be directed to the host in one cycle through all available hosts. For example, the value `instance-1:1,instance-2:4` means that for every connection to `instance-1`, there will be four connections to `instance-2`.

**Note:** The `` value in the string must be an integer greater than or equal to 1. | `null` | | | `roundRobinDefaultWeight` | This parameter value must be an integer value in the form of a `string`. This parameter represents the default weight for any hosts that have not been configured with the `roundRobinHostWeightPairs` parameter. For example, if a connection were already established and host weights were set with `roundRobinHostWeightPairs` but a new reader node was added to the database, the new reader node would use the default weight.

**Note:** This value must be an integer greater than or equal to 1. | `1` | +| `fastestResponse` | See the following rows for configuration parameters. | The fastest response strategy identifies the fastest response host, then stores this host in a cache for future use.

**Note:** The Fastest Response Strategy plugin must also be loaded into the plugins list by setting the `plugins` connection configuration parameter to include the `fastestResponseStrategy` plugin code. | N/A | +| | `responseMeasurementIntervalMs` | Interval in millis between measuring response time to a database node. | `30000` | diff --git a/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md b/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md index 2c249b666..d261899c2 100644 --- a/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md +++ b/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md @@ -207,6 +207,7 @@ The AWS JDBC Driver has several built-in plugins that are available to use. Plea | [Developer Plugin](./using-plugins/UsingTheDeveloperPlugin.md) | `dev` | Any database | Helps developers test various everyday scenarios including rare events like network outages and database cluster failover. The plugin allows injecting and raising an expected exception, then verifying how applications handle it. | None | | [Aurora Initial Connection Strategy](./using-plugins/UsingTheAuroraInitialConnectionStrategyPlugin.md) | `initialConnection` | Aurora | Allows users to configure their initial connection strategy to reader cluster endpoints. | None | | [Limitless Connection Plugin](./using-plugins/UsingTheLimitlessConnectionPlugin.md) | `limitless` | Aurora | Enables client-side load-balancing of Transaction Routers on Amazon Aurora Limitless Databases . | None | +| Fastest Response Strategy Plugin | `fastestResponseStrategy` | Aurora | When read-write splitting is enabled, this plugin selects the reader to switch to based on the host with the fastest response time. The plugin achieves this by periodically monitoring the hosts' response times and storing the fastest host in a cache. **Note:** the `readerHostSelectorStrategy` parameter must be set to `fastestResponse` in the user-defined connection properties in order to enable this plugin. See [reader selection strategies](./ReaderSelectionStrategies.md) | None | [^1]: [RDS Multi-AZ DB Clusters do not support IAM](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.Limitations.html). [^2]: Federated Identity and Okta rely on IAM. Due to [^1], RDS Multi-AZ Clusters are not supported. diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/strategy/fastestresponse/FastestResponseStrategyPlugin.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/strategy/fastestresponse/FastestResponseStrategyPlugin.java index d12a8df35..1f6cd6766 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/strategy/fastestresponse/FastestResponseStrategyPlugin.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/strategy/fastestresponse/FastestResponseStrategyPlugin.java @@ -51,6 +51,8 @@ public class FastestResponseStrategyPlugin extends AbstractConnectionPlugin { private static final Set subscribedMethods = Collections.unmodifiableSet(new HashSet() { { + add("connect"); + add("forceConnect"); add("notifyNodeListChanged"); add("acceptsStrategy"); add("getHostSpecByStrategy");