Datasource Reusability and Connection Pool Optimization

The current implementation of PgTenantBasedDestinationResolver creates a new HikariDataSource for each partition, even if multiple partitions share the same database credentials.

This leads to inefficient resource usage by creating an excessive number of connection pools, which can strain database resources and increase memory consumption.

The goal is to optimize this behavior by reusing HikariDataSource instances. When different partitions point to the same database (i.e., have identical connection URLs, usernames, and passwords), they should share a single connection pool. This will reduce the number of open connections and improve overall application performance and resource management.

Assignee Loading
Time tracking Loading