I have SpringBoot microservices which points to MSSQL (primary/secondary, no Listner) and getting DB connection from config engine. Below are the properties.
spring.datasource.url=jdbc:sqlserver://{primarydb}:{port};databaseName={DBname};failoverPartner={secondarydb};databaseName={DBname}
spring.datasource.username={user}
spring.datasource.password={passwd}
Since we don't have Listner for our DB, when DBA switch primarydb our microservices start failing. Once we loose DB connection we should receive an email/phone text notification. Can somebody please guide me how to acheive this?
As a workaround we restage those microservices in order to establish DB connection. In future we are going to have Listner for our DB which will point to primary/secondary whichever is active.