r2dbc/r2dbc-proxy

Unable to instantiate a ProxyExecutionListener via URL when it has a constructor dependency

sachinstar2010 opened this issue · 2 comments

Feature Request

Is your feature request related to a problem? Please describe

When the url has a proxyListener, which takes a constructor parameter, the URL based invocation doesn't work.

Example:
url:r2dbc:proxy:mysql://localhost:3306/?proxyListener=com.example.QueryTimeMetricsExecutionListener

When this class needs a MeterRegistry from Micrometer, the URL based instantiation fails.

Describe the solution you'd like

Given a ProxyExecutionListener with dependencies, should be able to wire that up from the URL instead of the programmatic way.

Describe alternatives you've considered

Alternative is to use the programmatic way of constructing the ConnectionFactory. Spring R2DBC provides auto configuration and hence, want to make this working there.

Teachability, Documentation, Adoption, Migration Strategy

@ttddyy Requesting you to have a look at this issue.

The connection parsing and instantiation in r2dbc-proxy is limited to no-arg instantiation.
This is because the r2dbc-proxy is not aware of the spring container.

If Spring Data R2DBC provides dependency injection to the r2dbc infrastructure components, it is more appropriate that this feature is implemented there.