Change spring data r2dbc context to use R2dbcRepositories in a different database

1.2k views Asked by At

How can I change spring data r2dbc repositories target-datatabase (maybe I am talking about 'Context')?

Let me explain better.

I am managing(ConnectionFactory Properties) 'connection factory' to execute SQL-DDL scripts in any database I want - OK; however, R2dbcRepositories (REactiveCruRepository) methods, are not follow this database I have configured ConnectionFactory Properties.

How Can I change ConnectionFactory Properties, in order to, REactiveCruRepository points for this configuration done (meaning a new database)?

1

There are 1 answers

2
Hantsy On

It is very easy to configure another connection factory for your R2dbc Repositories.

Check my example about multiple R2dbc connection factories.