Relevant if Asynchronous messages feature is used. Introduced in OpenHub 2.1.

This feature is disabled by default. You can enable it by setting ohf.asynch.finalMessages.processingEnabled parameter to true.

Messages that are already processed should not be kept indefinitelly in OpenHub repository, for performance reasons. Therefore, mechanism called "final messages handling" is introduced.

Final message handling job

Messages that are considered final by workflow are periodically fetched by job (org.openhubframework.openhub.core.common.asynch.finalmessage.FinalMessagesProcessingJob) and processed. 

Message is final if it's in one of the following state: OK, FAILED or CANCEL

Enabling message handling job

Message processing

Is realized by beans of FinalMessageProcessor type. Generally speaking it can be anything, typical scenario will be some kind of archiving before deleting.

Processing order is defined by Order interface implementation.

Note: duration for keeping messages in OpenHub database can be configured differently per each state, for example ohf.asynch.finalMessages.ok.saveTimeInSec. See OpenHub configuration for configuration properties.

DeleteFinalMessageProcessor

How to add custom message processor?

Error handling