Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper way to organize diagnostic tests in Java EE

I am working on a Spring-based web-application that uses several components, including PostgreSQL, raw filesystem and more..

I want to make a small admin-page, where an admin will be able to test, if all components are working propery, e.g.:

  • if PostgreSQL is up, running, and accepts reads/writes
  • if the FileSystem is accesible, if there is some space left etc.
  • the same for other modules

Do you know of a design solution for this kind of problems (diagnostics/self-checks) ? Should I create methods in the modules that use those components (e.g. in PostgreSQL data access layer) that perform dummy writes and reads confiriming, that the given service/component is working?

like image 646
Luce Ian Avatar asked Nov 12 '22 01:11

Luce Ian


1 Answers

You should write MBean using JMX technology for every resource you want to monitor. Implementation of MBeans is up to you (yes, you may do read/writes for DBMS for example).

like image 184
artplastika Avatar answered Nov 14 '22 23:11

artplastika