Frequently polling a task result API wastes resources and may trigger rate limiting due to high request frequency. Alibaba Cloud Model Studio supports actively pushing task completion notifications through EventBridge after task processing finishes. Configure an HTTP callback URL or a RocketMQ message queue to receive these notifications. After receiving a notification, query the result once to obtain the task output—eliminating frequent polling.
Background
Alibaba Cloud Model Studio’s asynchronous tasks integrate with EventBridge. EventBridge acts as an event relay service, routing events to configured event targets (i.e., event receivers). In this context, a “notification” is a specific “event” in the EventBridge system.
After Alibaba Cloud Model Studio finishes processing an asynchronous task—whether successful or failed—it generates a “task completion event” (containing task status, task ID, etc.) and reports it to EventBridge. EventBridge then delivers this event to your configured event target. For more event targets and configuration methods, see Event targets and Target service types.
Active polling vs. receiving asynchronous task completion notifications
Comparison dimension | Active polling | Receiving asynchronous task completion notifications |
Is rate limiting enabled? | Result query API is rate-limited (20 QPS) | No rate limiting |
Integration complexity | Simple—just poll the result query API. Some tasks (such as text-to-image and text-to-video) provide an SDK with built-in polling. If no SDK is available, implement polling yourself. | Slightly more complex. You must configure an HTTP callback URL or RocketMQ in EventBridge and parse the delivered notification. |
Server resource consumption | Polling consumes your business system resources, especially with high-frequency queries. | Does not consume your business system resources—EventBridge pushes proactively. |
Real-time performance | Low real-time performance—depends on polling frequency. | High real-time performance—pushed immediately after task completion. |
Recommendation | Suitable for low-concurrency, small-scale tasks or scenarios with low real-time requirements. | Suitable for high-concurrency, large-scale tasks or scenarios with high real-time requirements. |
To receive asynchronous task completion notifications, configure event targets in EventBridge. Common options include the following:
Configure an HTTP callback URL: Requires an HTTP URL accessible over the public network or an Alibaba Cloud VPC, supporting POST requests. Suitable for most general scenarios.
Configure RocketMQ: Receive and consume events using Message Queue for RocketMQ. Ideal for scenarios requiring high message reliability.
Option 1: Configure an HTTP callback URL
Overview
After Alibaba Cloud Model Studio completes a task, it reports the task completion event to EventBridge. EventBridge then pushes this event to your callback endpoint. Your callback endpoint parses the event to extract the successfully processed task ID and calls the result query API once to retrieve the task output.
Benefits: Compared to direct polling, this approach avoids unnecessary polling requests, reduces resource consumption, and lowers pressure on the result query API’s rate limits.
Billing: EventBridge billing.
For example, the asynchronous invocation flow using an HTTP callback URL for text-to-image is as follows:
|
|
Procedure
Option 2: Configure RocketMQ
Overview
After Alibaba Cloud Model Studio completes a task, it reports the task completion event to EventBridge. EventBridge forwards the event to Message Queue for RocketMQ. Your application listens to the message queue, consumes the message, extracts the completed task ID, and calls the result query API once to retrieve the task output.
Benefits: Unlike the HTTP callback approach, RocketMQ guarantees message delivery and supports retry on failure—ideal for scenarios requiring high message reliability.
Billing: EventBridge billing, RocketMQ billing.
For example, the asynchronous invocation flow using RocketMQ for text-to-image is as follows:
|
|
Procedure
FAQ
Can one event rule have multiple event targets?
Yes. A single event rule can have multiple event targets. If configured, the same event is delivered to every target.
I configured an event rule but am not receiving events. Why?
Ensure the event forwarding rule’s region matches the event’s region. For example, a rule configured in the Beijing region only forwards Beijing-region events—not Shanghai or other regions. Check the EventBridge region in the region selector at the top of the console page.
HTTP/HTTPS service request times out or returns an error?
Follow these steps to troubleshoot:
Check the HTTP/HTTPS service status.
Verify the URL configured in the event target.
Check the network type configured for the event target:
PublicNetwork: Public network—ensure the URL is publicly accessible.
PrivateNetwork: VPC network—if selected, verify VPC, vSwitch, and SecurityGroup configurations.
Check VPC and vSwitch settings.
Check network security group settings.
For other parameter settings, see Event target parameters.

