Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ FunctionGraph/ User Guide (ME-Abu Dhabi Region)/ Configuring Functions/ Configuring Asynchronous Execution Notification

Configuring Asynchronous Execution Notification

Updated on 2023-11-21 GMT+08:00

Overview

Functions can be invoked synchronously or asynchronously. In asynchronous mode, FunctionGraph sends a response immediately after persisting a request. The request result cannot be known in real time. To retry when an asynchronous request fails or obtain asynchronous processing results, configure asynchronous settings.

Scenario

  • Retry: By default, FunctionGraph does not retry if a function fails due to a code error. If your function needs retry, for example, if third-party services often fail to be invoked, configure retry to improve the success rate.
  • Result notifications: FunctionGraph automatically notifies downstream services of the asynchronous execution result of a function for further processing. For example, storing execution failure information in OBS for cause analysis, or pushing execution success information to DIS or triggering the function again.

Procedure

  1. Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the function to be configured to go to the function details page.
  3. Choose Configuration > Configure Async Notification. On the displayed page, click Edit next to Asynchronous Notification Policy.

    Figure 1 Configuring an asynchronous notification policy

  4. Set parameters by referring to Table 1. For example, specify FunctionGraph for Target Service.

    Figure 2 Setting parameters
    Table 1 Parameter description

    Parameter

    Description

    Asynchronous Execution Notification Policy

    • Max. Retries: maximum number of retries when asynchronous invocation fails. Value range: 0–3. Default value: 1.
    • Max. Validity Period (s): maximum lifetime of a message in seconds. Value range: 1–86,400.

    Success Notification

    Target Service: to which a notification will be sent if a function is executed successfully.

    1. FunctionGraph
    2. OBS

    Failure Notification

    Target Service: to which a notification will be sent if a function fails to be executed.

    1. FunctionGraph
    2. OBS

  5. Click OK.

    NOTE:
    1. Set an agency that allows FunctionGraph to access the target service.
    2. To avoid cyclic invocation, do not set two functions as asynchronous execution targets of each other.

Configuration Description

For details about how to set the target for asynchronous invocation, see Table 2. The following shows an example:

{
        "timestamp": "2020-08-20T12:00:00.000Z+08:00",
	"request_context": {
	        "request_id": "1167bf8c-87b0-43ab-8f5f-26b16c64f252",
	        "function_urn": "urn:fss:xx-xxxx-x:xxxxxxx:function:xxxx:xxxx:latest",
	        "condition": "",
	        "approximate_invoke_count": 0
	 },
	    "request_payload": "",
	    "response_context": {
	        "status_code": 200,
	        "function_error": ""
	  },
	 "response_payload": "hello world!"
}
Table 2 Parameter description

Parameter

Description

timestamp

Time when the invocation starts.

request_context

Request context.

request_context.request_id

ID of an asynchronous invocation request.

request_context. function_urn

URN of the function that is to be executed asynchronously.

request_context.condition

Invocation error type.

request_context. approximate_invoke_count

Number of asynchronous invocation times. If the value is greater than 1, function execution has been retried.

request_payload

Original request payload.

response_context

Response context.

response_context.statusCode

Code returned after function invocation. If the code is not 200, a system error occurred.

response_context.function_error

Invocation error information.

response_payload

Payload returned after function execution.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback