Adds note about HikariDataSource and refreshable.

See gh-395
This commit is contained in:
Spencer Gibb
2018-10-04 11:57:29 -04:00
parent 6c9231a4da
commit 1c03cbc067

View File

@@ -183,6 +183,10 @@ is "immutable", you will have to either annotate the bean with `@RefreshScope`
or specify the classname under the property key
`spring.cloud.refresh.extra-refreshable`.
IMPORTANT: If you create a `DataSource` bean yourself and the implementation is a `HikariDataSource`, return the
most specific type, in this case `HikariDataSource`. Otherwise, you will need to set
`spring.cloud.refresh.extra-refreshable=javax.sql.DataSource`.
Refresh scope beans are lazy proxies that initialize when they are used (that is, when a method is called), and the scope acts as a cache of initialized values.
To force a bean to re-initialize on the next method call, you must invalidate its cache entry.