-
Notifications
You must be signed in to change notification settings - Fork 40.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Vibur DBCP connection pool to DataSourceBuilder #42903
Comments
Thanks for the suggestion. As you may have seen, there is really two separate pieces to it:
1 is a better place for your request, IMO. |
@snicoll, thanks a lot for looking into this ticket and thanks for prototyping the hack. I'm thinking that if only the changes from the first piece that is in the Currently, the other connection pools are configured via the 4 properties with prefix For Vibur pool I would imagine that the pool specific properties prefix can be
If I'm misunderstanding some details about the connection pool's configuration in a spring-boot application, please point me out where. If, in fact, you're saying that is possible Vibur pool to be easily configured (including its specific properties) and used in a spring-boot application with only the changes that you proposed yesterday, can you please show an example how to do that? |
@simeonmalchev please hold on until the team had a chance to review this.
I never said that. |
No problem at all. |
We discussed this today and we'd like to add support in the I'll repurpose this issue and we'll merge @snicoll's prototype code later. |
@philwebb, thanks for the update. I'm trying to figure out what will be the best way to post-configure the Vibur DBCP pool specific properties after the support for it is added in the |
Hi @snicoll, I'm not sure if you'll get this message as this issue is now closed, but I just released a new version of Vibur-DBCP 26.0 yesterday. Can you please update the Vibur version in your commit above, or I should try myself to make a PR for updating it? |
Neither. The commit has been pushed, we can't change it. We don't need a PR as we have a semi-automated process that does it. Your case is however special has we don't generally upgrade to new majors in a feature release automatically so I'll keep an eye on it. |
@snicoll, thanks! I'm apologizing for the major version change. Vibur doesn't follow a strict semver as x.y.z, it just does x.y and usually each new release changes the x. It just started like that long time ago... |
Please add support / auto-configuration for Vibur DBCP connection pool (https://github.com/vibur/vibur-dbcp) in spring-boot.
Vibur DBCP is a concurrent, fast, and fully-featured JDBC connection pool, which has been around since 2013. The pool provides advanced performance monitoring capabilities, including slow SQL queries detection and logging, a non-starvation guarantee for application threads, statement caching, among other features.
Currently, spring-boot has built-in support for auto-configuration of the following jdbc connection pools in this order:
This issue is, in fact, to add Vibur DBCP to the above list. The Vibur DataSource class that needs to be instantiated is
org.vibur.dbcp.ViburDBCPDataSource.class
.To the best of my understanding, adding support for Vibur will involve as a minimum changes in the
DataSourceAutoConfiguration
andDataSourceConfiguration
classes fromspring-boot-autoconfigure
, and in theDataSourceBuilder
class fromspring-boot
.Note that Vibur requires its
start()
method to be called once the pool is configured. This method will validate the pool configuration. The pool also implements aclose()
method as part of its implementation ofAutoClosebale
.If Vibur connection pool had to be instantiated from Java programming code, without the help of the
spring.datasource.url
,spring.datasource.username
,spring.datasource.password
,spring.datasource.driver-class-name
properties, this could be done via something like:The above snippet assumes that all Vibur config properties have a prefix of
spring.datasource.vibur
.The disadvantage of such instantiation is that Vibur cannot utilize the mentioned earlier and standard for spring-boot 4 config properties with a prefix of
spring.datasource
. These 4 properties have to be repeated with a prefix ofspring.datasource.vibur
, where theurl
property needs be namedjdbc-url
as this is the name of the internal Vibur jdbc url property.Disclaimer, I'm the author of Vibur DBCP. I'm happy to help with any questions which you may have about Vibur DBCP configuration or setup.
The text was updated successfully, but these errors were encountered: