diff --git a/obp-api/src/main/resources/props/sample.props.template b/obp-api/src/main/resources/props/sample.props.template index 0a057070d7..8ffcfd07cb 100644 --- a/obp-api/src/main/resources/props/sample.props.template +++ b/obp-api/src/main/resources/props/sample.props.template @@ -123,9 +123,12 @@ long_endpoint_timeout = 55000 #This is the api instance, we create kafka topic based on this number, each instance should have each own id. use it in load balancing + Kafka setup #This is also used for scheduler. -#OBP will concatenate the UUID string with the value. If we set the value to end with "final", obp will retain that value. +#OBP set the default as the non-persistent UUID string. +#api_instance_id=7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh +#If a value is set, OBP will concatenate the UUID string with the value. #api_instance_id=1 -api_instance_id=1_final +#When the value is set to conclude with "final," OBP will preserve that value. +#api_instance_id=1_final ## DEPRECATED ## Enable user authentication via kafka diff --git a/obp-api/src/main/resources/props/test.default.props.template b/obp-api/src/main/resources/props/test.default.props.template index 44550f1a55..8f5102df60 100644 --- a/obp-api/src/main/resources/props/test.default.props.template +++ b/obp-api/src/main/resources/props/test.default.props.template @@ -15,9 +15,6 @@ ### if logger.logfile is defined #logger.logfile="obp-api.log" -#This is the api instance -api_instance_id=1_final - #which data connector to use #connector=rest diff --git a/obp-api/src/main/scala/code/api/constant/constant.scala b/obp-api/src/main/scala/code/api/constant/constant.scala index 8d7064dc6e..6ace561278 100644 --- a/obp-api/src/main/scala/code/api/constant/constant.scala +++ b/obp-api/src/main/scala/code/api/constant/constant.scala @@ -25,11 +25,15 @@ object Constant extends MdcLoggable { final val HostName = APIUtil.getPropsValue("hostname").openOrThrowException(ErrorMessages.HostnameNotSpecified) final val ApiInstanceId = { - val apiInstanceIdFromProps = APIUtil.getPropsValue("api_instance_id").openOrThrowException(ErrorMessages.ApiInstanceIdNotSpecified) - if(apiInstanceIdFromProps.endsWith("final")){ - apiInstanceIdFromProps + val apiInstanceIdFromProps = APIUtil.getPropsValue("api_instance_id") + if(apiInstanceIdFromProps.isDefined){ + if(apiInstanceIdFromProps.head.endsWith("final")){ + apiInstanceIdFromProps.head + }else{ + s"${apiInstanceIdFromProps.head}_${APIUtil.generateUUID()}" + } }else{ - s"${apiInstanceIdFromProps}_${APIUtil.generateUUID()}" + APIUtil.generateUUID() } } diff --git a/release_notes.md b/release_notes.md index ed8d397c7f..efcd1f5f1e 100644 --- a/release_notes.md +++ b/release_notes.md @@ -122,7 +122,7 @@ Date Commit Action 1. accountaccess_backup_2019_05_17_11_16_32_134 2. viewdefinition_backup_2019_05_17_11_16_31_862 29/04/2019 a6b58a1 Added Props system_environment_property_name_prefix, default is OBP_. This adds the prefix only for the system environment property name, eg: db.driver --> OBP_db.driver -07/07/2018 4944572 Added Props api_instance_id, default is 1. This deceides the current api instance number, start from 1. +07/07/2018 4944572 Added Props api_instance_id, default is non-persistent UUID 7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh. 29/06/2018 7422894 Added Props logging.database.queries.enable, default is false. This should enable logging all the database queries in log file. 01/06/2018 a286684 Added Props write_connector_metrics, default is false. This decides whether the connector level metric save or not 29/05/2018 c0d50b5 Added Props kafka.partitions, default is 3. This should match the partitions in Kafka config