Trading Networks 10.7 | Administering and Monitoring B2B Transactions | Service Development Help | Working with MQTT Triggers | Transient Error Handling for an MQTT Trigger | Building a Resource Monitoring Service for an MQTT Trigger
 
Building a Resource Monitoring Service for an MQTT Trigger
A resource monitoring service is a service that you create to programmatically check the availability of resources used by a trigger. Integration Server schedules a system task to execute a resource monitoring service after an MQTT trigger is stopped because of retry failure. Specifically, when retry failure occurs and the MQTT trigger specifies the retry failure handing option Stop trigger, Integration Server temporarily disables the MQTT trigger and invokes the associated resource monitoring service. When the service indicates resources are available, Integration Server enables the MQTT trigger. Use of a resource monitoring service removes the need to enable the trigger manually.
The same resource monitoring service can be used for multiple triggers. When the service indicates that resources are available, Integration Server enables all the MQTT triggers that use the resource monitoring service.
A resource monitoring service must do the following:
*Use the pub.trigger:resourceMonitoringSpec as the service signature.
*Check the availability of the resources used by the document resolver service and all the trigger services associated with a trigger. Keep in mind that each condition in a trigger can be associated with a different trigger service. However, you can only specify one resource monitoring service per trigger.
*Return a value of “true” or “false” for the isAvailable output parameter. The author of the resource monitoring service determines what criteria makes a resource available.
*Catch and handle any exceptions that might occur. If the resource monitoring service ends because of an exception, Integration Server logs the exception and continues as if the resource monitoring service returned a value of “false” for the isAvailable output parameter.