[
https://issues.apache.org/jira/browse/CAMEL-22927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18055161#comment-18055161
]
Luis Sergio Faria Carneiro commented on CAMEL-22927:
----------------------------------------------------
PR: https://github.com/apache/camel/pull/21142
> camel-sql endpoint opening unnecessary connections to the database if service
> location is enabled
> -------------------------------------------------------------------------------------------------
>
> Key: CAMEL-22927
> URL: https://issues.apache.org/jira/browse/CAMEL-22927
> Project: Camel
> Issue Type: Improvement
> Components: camel-sql
> Affects Versions: 4.17.0
> Reporter: Luis Sergio Faria Carneiro
> Priority: Minor
>
> The sql/sql-stored components may open unnecessary connections to the
> database if service location is enabled.
> We faced an issue where we are using Apache Commons DBCP
> [BasicDataSource|https://github.com/apache/commons-dbcp/blob/master/src/main/java/org/apache/commons/dbcp2/BasicDataSource.java#L1090].
> During the sql component initialization phase, it would get the properties
> from that class, which includes {{{}getLogWriter(){}}}.
> This method creates a real connection to the database which is not needed for
> the purposes of service location, as it is interested only in jdbc url and
> username.
> And it got worse in a scenario where an Azure MySQL Database was stopped.
> Each connection attempt was taking 2+ minutes to finish as no timeout was
> configured in the connection url. Having a few sql endpoints on my route
> caused the camel context to take more than 10 minutes to start.
> The purpose here is to adjust the component so that it only reads the
> necessary properties.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)