Here is my requirement:
My java service is continuous running process. When the java service start, it loads the configuration from one of the table in MySql
database.
When there are any changes (can be insert/update/delete
, outside the java service also possible), java service should reloaded the configuration immediately.
I saw a post in stackoverflow which is for Oracle database, but I am looking for Mysql database.
I can able to achieve this using separate thread, which polling the database table with some interval. But, polling for change is a not a good way to do. Instead, I am looking for any Watcher/Listener which will notify when there is any change in the MySql table.
Can anybody help me to achieve this?
Note: If this question is already answered somewhere, please post the link in the comment, I will remove this question.