r2dbc / r2dbc-pool

Connection Pooling for Reactive Relational Database Connectivity
https://r2dbc.io
Apache License 2.0
332 stars 55 forks source link

Spring Boot JMX configuration is awkward #118

Closed amoffet closed 3 years ago

amoffet commented 3 years ago

Bug Report

Versions

Current Behavior

When enabling JMX for the pool, it appears that you must do this: ConnectionFactoryOptions.Builder builder = ConnectionFactoryOptions.builder().from(baseOptions) ... .option(Option.valueOf("registerJmx"), "true") instead of . .option(PoolingConnectionFactoryProvider.REGISTER_JMX, Boolean.TRUE)

because line 167 of PoolingConnectionFactoryProvider insists on a string.
mapper.from(REGISTER_JMX).as(registerJmx -> registerJmx.equals("true")).to(builder::registerJmx);

This seems very incorrect.

Moreover, this option, along with the name of the pool, should be externally configurable in R2dbcProperties.Pool through R2dbcAutoConfiguration.

Expected behavior/code

I should be able to use a standardized value for the registerJmx option if I am configuring it manually, and it should be able to be configured externally if I am using Spring Boot

mp911de commented 3 years ago

That issue was fixed with #113.