Throttle Asynchronous MDNs when using webMethods EDIINT Module

Requirement

We have experienced an issue with a Trading partner who is sending us a very large number of messages over AS/2 and requesting an asynchronous MDN.  From an inbound message perspective, the Trading Partner is restricting inbound to a single payload at a time however, the outbound MDNs are spawning rapidly and filling up our thread pool.  Having no control over this process is dangerous to our environment as a whole.

We would like to see an enhancement where the MDNs do not run through spawned threads.  Instead, we could control throughput by putting the jobs into a job queue (perhaps DB) which could then be processed by a thread pool, which could itself be controlled.

Solution

Refer the below steps to achieve the above-mentioned requirements.

  1. Register a BATCH service in TN, Logic:
    1. Input signature: "queue"
    2. Call the service wm.tn.queuing:listQueuedTasks to get the list of queued task for that queue
    3. LOOP over taskids resulted by point b.
    4. Call the service wm.tn.task:getTask to get the task with content
    5. BRANCH on /task/InputData/bizdoc/SystemStatus; resulted from point d.
    6. Create a SEQUENCE labelled QUEUED
      1. Call the service wm.EDIINT.delivery:deliveryDocument, mapping the task/InputData/bizdoc with deliveryDocument Input bizdoc
    7. Default is EXIT from $parent.
  2. Create a public QUEUE for registered Batch service
  3. Create a processing rule with following requirements:
    1. Processing rule ordinal should be above Default EDIINT processing rule "EDIINT Send MDN Message"
    2. Select Sender and receiver if you wish
    3. Select the Document Types EDIINT MDN
    4. Specify the User Status as "SendMDNMsg"
    5. Under Extended Criteria, add "EDIINT Delivery URI" Not Equals null
    6. Under Action tab, Select Deliver document by Scheduled delivery and select the created queue in 2nd point.

Complete Solution in the package can be downloaded from attachments (Install as IS package). This package automatically registers a scheduled service with TN; the logic of the service is defined in point 1.  To use the package just follow from point 2 to 3.

Disclaimer
This solution has not been tested thoroughly and might have multiple issues and even error handlings and loggings are missing from multiple places, in short, it is not production ready.

Throttle.zip (11.3 KB)