@@ -174,10 +174,27 @@ public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) {
174
174
jpaStorageSettings .setDeferIndexingForCodesystemsOfSize (
175
175
appProperties .getDefer_indexing_for_codesystems_of_size ());
176
176
177
+ jpaStorageSettings .setResourceClientIdStrategy (appProperties .getClient_id_strategy ());
178
+ ourLog .info ("Server configured to use '" + appProperties .getClient_id_strategy () + "' Client ID Strategy" );
179
+
180
+ // Set and/or recommend default Server ID Strategy of UUID when using the ANY Client ID Strategy
177
181
if (appProperties .getClient_id_strategy () == JpaStorageSettings .ClientIdStrategyEnum .ANY ) {
178
- jpaStorageSettings .setResourceServerIdStrategy (JpaStorageSettings .IdStrategyEnum .UUID );
179
- jpaStorageSettings .setResourceClientIdStrategy (appProperties .getClient_id_strategy ());
182
+ if (appProperties .getServer_id_strategy () == null ) {
183
+ ourLog .info ("Defaulting server to use '" + JpaStorageSettings .IdStrategyEnum .UUID
184
+ + "' Server ID Strategy when using the '" + JpaStorageSettings .ClientIdStrategyEnum .ANY
185
+ + "' Client ID Strategy" );
186
+ appProperties .setServer_id_strategy (JpaStorageSettings .IdStrategyEnum .UUID );
187
+ } else if (appProperties .getServer_id_strategy () != JpaStorageSettings .IdStrategyEnum .UUID ) {
188
+ ourLog .warn ("WARNING: '" + JpaStorageSettings .IdStrategyEnum .UUID
189
+ + "' Server ID Strategy is highly recommended when using the '"
190
+ + JpaStorageSettings .ClientIdStrategyEnum .ANY + "' Client ID Strategy" );
191
+ }
180
192
}
193
+ if (appProperties .getServer_id_strategy () != null ) {
194
+ jpaStorageSettings .setResourceServerIdStrategy (appProperties .getServer_id_strategy ());
195
+ ourLog .info ("Server configured to use '" + appProperties .getServer_id_strategy () + "' Server ID Strategy" );
196
+ }
197
+
181
198
// Parallel Batch GET execution settings
182
199
jpaStorageSettings .setBundleBatchPoolSize (appProperties .getBundle_batch_pool_size ());
183
200
jpaStorageSettings .setBundleBatchPoolSize (appProperties .getBundle_batch_pool_max_size ());
0 commit comments