Class WorkflowMessageService

java.lang.Object
com.axelor.workflow.message.WorkflowMessageService

public class WorkflowMessageService extends Object
Offers sent messages to whatever is waiting for them; the scheduler decides when. A row nobody takes stays pending and is offered again on the next poll, until it is taken or expires.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    deliver(Long messageId)
    Offer one message to every park correlated to it, counting the attempt either way.
    pendingIds(int limit)
    Messages still looking for a subscriber, least-offered first and oldest first among equals, so every pending row gets an offer before any gets a second, and a fresh send is taken on the next poll.
    void
    recordAttempt(Long messageId)
    Count an offer whose delivery threw, so the row moves to the back rather than blocking the head of the queue.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WorkflowMessageService

      public WorkflowMessageService()
  • Method Details

    • pendingIds

      public List<Long> pendingIds(int limit)
      Messages still looking for a subscriber, least-offered first and oldest first among equals, so every pending row gets an offer before any gets a second, and a fresh send is taken on the next poll.
    • recordAttempt

      public void recordAttempt(Long messageId)
      Count an offer whose delivery threw, so the row moves to the back rather than blocking the head of the queue.
    • deliver

      public int deliver(Long messageId)
      Offer one message to every park correlated to it, counting the attempt either way. Two nodes may offer the same row: each park is claimed by one winner and the row settles once.
      Returns:
      how many parks this offer woke