Message Queue Processor Automation
Description
This automation demonstrates asynchronous message queue processing using the mqHandler trigger type. It shows how to process messages from a named queue to handle background tasks, decouple system components, and manage workload distribution. This pattern is essential for scalable architectures where time-consuming operations need to be processed asynchronously without blocking user interactions.
Use Case
Used in a subscription system to process validation tasks asynchronously. When a subscription is created or updated, a message is added to the validation queue. This automation processes those messages in the background, performing validation checks, data enrichment, and workflow updates without impacting the user experience.
Key Features
- Named queue subscription for targeted processing
- Message body parameter extraction
- Asynchronous background processing
- Decoupled architecture pattern
- Scalable workload distribution
- Error isolation and retry capability
JSON Definition
{
"key": "process_queue_subscription_validation",
"name": "Process Queue subscription_validation",
"entityKey": "subscription",
"app": "sub",
"triggerType": "mqHandler",
"triggerParams": {
"queueName": "subscription_validation"
},
"actions": [
{
"name": "Execute validation step",
"key": "handle_step",
"actionTypeKey": "handle_subscription_validation_wf_step",
"params": {
"subscriptionId": "{{trigger.message.body.entityId}}"
}
}
]
}
Notes
- Queue names should be descriptive and follow a naming convention
- Messages are processed in FIFO order within priority levels
- Failed messages can be retried or sent to dead letter queues
- The message body can contain complex JSON structures
- Queue processors can scale horizontally for high throughput
- This pattern enables event-driven architecture
- Message processing is atomic - success or rollback