Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • we use the following configuration (see org.openhubframework.openhub.core.common.asynch.AsynchMessageRoute#URI_ASYNC_PROCESSING_MSG)
    • ASYNCH_CONCURRENT_CONSUMERS corresponds to the parameter ohf.asynch.concurrentConsumers, see OpenHub configuration
    • PRIORITY_QUEUE_FACTORY refers to Spring bean with the name "priorityQueueFactory"
    • queue size must be big enough for saving incoming requests otherwise thread that adds new message will wait
Code Block
    public static final String URI_ASYNC_PROCESSING_MSG = "seda:asynch_message_route"
            + "?concurrentConsumers={{" + ASYNCH_CONCURRENT_CONSUMERS + "}}&waitForTaskToComplete=Never"
            + "&blockWhenFull=true&queueFactory=#" + PRIORITY_QUEUE_FACTORY;
  • default value of size or queueSize (maximum capacity of the SEDA queue i.e., the number of messages it can hold) is Integer.MAX_VALUE 
  • queue size must be big enough for saving incoming requests otherwise thread that adds new message will wait
  • SEDA uses PriorityBlockingQueueFactory (not default LinkedBlockingQueue implementation)
    • queue is sorted (see org.openhubframework.openhub.core.common.asynch.msg.MsgPriorityComparator) by processing priority attribute defined at Message object. 
    • incoming (new) requests have higher priority than re-processing messages 

...