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.
Refer the below steps to achieve the above-mentioned requirements.
- Register a BATCH service in TN, Logic:
- Input signature: "queue"
- Call the service wm.tn.queuing:listQueuedTasks to get the list of queued task for that queue
- LOOP over taskids resulted by point b.
- Call the service wm.tn.task:getTask to get the task with content
- BRANCH on /task/InputData/bizdoc/SystemStatus; resulted from point d.
- Create a SEQUENCE labelled QUEUED
- Call the service wm.EDIINT.delivery:deliveryDocument, mapping the task/InputData/bizdoc with deliveryDocument Input bizdoc
- Default is EXIT from $parent.
- Create a public QUEUE for registered Batch service
- Create a processing rule with following requirements:
- Processing rule ordinal should be above Default EDIINT processing rule "EDIINT Send MDN Message"
- Select Sender and receiver if you wish
- Select the Document Types EDIINT MDN
- Specify the User Status as "SendMDNMsg"
- Under Extended Criteria, add "EDIINT Delivery URI" Not Equals null
- 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.