We have written customized scheduled services that look up data in a database. Sometimes, that database breaks down. It usually takes a few hours until it is back on its feet. During that time, our scheduled services, querying the DB, continue running and fail repeatedly.
The above situation causes thousands of emails that are sent. We could of course turn off the failure messages altogether (web-based admin console under Settings-> Logging), but that is not a realistic option, because we would like to remain informed of such failures.
What we really need is a way to intercept the messages before they are sent off to the SMTP host. We would like to know what Java code is called if a service fails, and how we could route these calls to a different class that would act as a “filter”. We would then write code that does such filtering, on criteria that we define ourselves.
We are using B2BServer 4.0.1, with plans to migrate to 4.6.
Has anyone done something like this before? Can it be done?