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.
Set it up¶
- 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 - 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, optionalMessageLabel), and return an acknowledgement with a reference number. - Build the worker flow
Start a second flow with an MsMq source that hasCollectFromQueue=Trueon 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, withUserCorrelationIdto match replies. - Handle failures
Add an Error link from the job to a shared error flow that records the failure and alerts your support team. - 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.