Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


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

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 and processed. 

Enabling message handling job

  • see configuration property ohf.asynch.finalMessages.processingEnabled in OpenHub configuration
  • interval & maximum limit of messages in one job loop can be configured

Message processing

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

Note: duration to keep messages in OpenHub database can be configured differently per each state. See OpenHub configuration for configuration properties.

DeleteFinalMessageProcessor

  • implementation provided in OpenHub, does delete all the messages in the database
  • can be enabled/disabled by configuration property (ohf.asynch.finalMessages.deleteProcessor.enabled)
  • has defined Order, specified in static final variable.

How to add custom message processor?

  • register bean of type FinalMessageProcessor, preferrably class AbstractFinalMessageProcessor should be extended.
  • define custom Order, relevant if multiple processors are registered.
  • implement method to process message, FinalMessageProcessor is FunctionalInterface.
  • method to process message is invoked in Transaction.

Error handling

  • if exception is thrown during message processing, job will continue with another one. In next job iteration the message will be processed again.
  • for multiple processors are registered, then if one throws exception, processing stops and transaction is rolled back. This mechanism tries to ensure, that messages will be processed with all the processors or none.
  • No labels