Skip to content

Asynchronous queue processing

Separate long-running work, such as scoring or document generation, from the request that triggers it. The caller gets an immediate acknowledgement and is notified when the work finishes.

REQUEST FLOW API host Push to MSMQ Acknowledge callerR00|Queued|reference WORKER FLOW Read from queue Run the job Webhook POSTto the caller Log and alert support on failure
Figure 4. The request flow queues the work and replies at once; a separate worker flow processes it and calls back.

Set it up

  1. Create the queues
    Create the private, transactional queues the interface uses before you deploy it, and give the i-Con service account read and write access. For example, in PowerShell on the server: PowerShellNew-MsmqQueue -Name "OrderRequestQ" -QueueType Private -Transactional Get-MsmqQueue -Name "OrderRequestQ" -QueueType Private | Set-MsmqQueueACL -UserName "DOMAIN\svc-icon" -Allow FullControl
  2. Build the request flow
    Receive the request with a host component, write it to the queue with an MsMq component (CollectFromQueue = False, SourceQueue = your queue, optional MessageLabel), and return an acknowledgement with a reference number.
  3. Build the worker flow
    Start a second flow with an MsMq source that has CollectFromQueue = True on the same queue. Run the job and post the result to the caller's webhook with RESTfulService. For IBM MQ, use MqSeries the same way, with UserCorrelationId to match replies.
  4. Handle failures
    Add an Error link from the job to a shared error flow that records the failure and alerts your support team.
  5. Run work in parallel where useful
    Use a StartComponent link to start work on its own thread while the main flow continues.

Use a correlation reference

Return the same reference in the acknowledgement and the webhook so the caller can match them. A GUID or a {Counter(name)} value works well.