CPI course - Create and use asynchronous interfaces

create by yi

Reprint please indicate the source

First, I will briefly introduce the synchronous interface and asynchronous interface

What is a synchronization interface

Synchronization interface means that the sender sends Message after , After processing, the interface will immediately return the execution result to the sender , This is the synchronization interface .

Synchronous interface is mostly used for small amount of data , A system that can process and return results immediately .

What is an asynchronous interface

Asynchronous interface means that the sender sends Message after , The interface party will immediately return whether the information is successfully received , General status is 202 Accepted, But the receiver is receiving Message after , Not immediately , Or it takes some time to implement , There is no way to return the execution result immediately , A relatively perfect interface will be implemented after , Then request the sender interface , Return the data to , Some interfaces require the sender to execute the query again after a certain time , Get the interface execution result .

Asynchronous interfaces are mostly used for data processing , Or a system that requires process processing , such as BPM System .

CPI How to create an asynchronous interface

Now let's talk about the creation steps

  1. First step , We need to create a new IFlow, You can create it yourself , Not detailed here .
  2. The second step , The sender creates a Soap Of Adapter, The parameters are as follows





    The following figure is a complete example I created



    among Content Modifier2 The sending time of the sender is recorded

    Groovy Is a delay code , The delay time is 3 second

    Content Modifier1 The sending time after delay is recorded , And created a Body, Send time , Record the delayed sending time

Here's the test

First of all we have Postman Create a connection in , Connect to the asynchronous interface of the test



Above we see , The execution time of the interface is 62ms, Sent body There is no limit , As long as it is consistent with soap canonical body Just go

Then let's see CPI Interface implementation of



As you can see from the picture above CPI This interface implements 3 A second more , But our Postman62ms The implementation has been completed

Let's see Body



In this way, we can simply create an interface for asynchronous execution

CPI course - More related articles on the creation and use of asynchronous interfaces

  1. be based on C# Of MongoDB Database development and Application (3)--MongoDB Database C# Development of asynchronous interface

    In the previous series of blogs , I once introduced ,MongoDB Database C# The driver has fully supported asynchronous processing interface , And the definition of the interface is almost rewritten . This paper mainly introduces MongoDB Database C# Driver's latest interface uses , Introduce how to implement... Based on the new interface ...

  2. hiredis Asynchronous interfaces are encapsulated and exported to Lua

    hiredis Asynchronous interfaces are encapsulated and exported to Lua( Jin Qing's column 2017.1)hiredis I won't support it Windows, Windows Next use wasppdotorg / hiredis-for-windows ...

  3. The correct way to open task queues and asynchronous interfaces (.NET Core edition )

    The correct way to open task queues and asynchronous interfaces What is an asynchronous interface ? Asynchronous Operations Certain types of operations might require processi ...

  4. java Unit testing is a test case of how to implement asynchronous interfaces

    Testing is an important part of software release , Unit testing is a commonly used testing method in practical development ,java Unit testing mainly uses junit, What's the latest junit5, My development is generally used junit4. Because unit testing can find problems as soon as possible before software modules are combined , the ...

  5. Python How to test asynchronous interfaces

    When business processing is time-consuming , Interfaces are generally processed asynchronously , This asynchronous processing method is also called Future Pattern . The general process When you request an asynchronous interface , The interface will immediately return you a result telling you that processing has started , The result usually includes a task i ...

  6. [ABP course ] Chapter one Create server

    Web Application development tutorial - Chapter one : Create server About this tutorial In this series of tutorials , You're going to build one called Acme.BookStore Is used to manage the list of books and their authors based on ABP Applications for . It was developed using the following technologies ...

  7. How to solve the problem of data error caused by uneven speed of asynchronous interface requests ? - DevUI

    DevUI It is an open source front-end solution for enterprise's middle and back-end products , It advocates immersion . flexible . Simple design values , Advocate designers to serve real needs , Design for most people , Refuse to make a fuss . Eye pleasing design . If you are developing ToB Tool products ...

  8. Swift3.0 The language tutorial uses encoding to create and initialize strings

    Swift3.0 The language tutorial uses encoding to create and initialize strings Use encoding to create and initialize strings In addition to using the methods mentioned above to create and initialize strings , You can also use init(coder:) Method , This method is not often used , Its grammatical form ...

  9. Swift3.0 The language tutorial uses pointers to create and initialize strings

    Swift3.0 The language tutorial uses pointers to create and initialize strings Swift3.0 The language tutorial uses pointers to create and initialize strings Swift The team put in a lot of effort to support it C Some basic features of .C The language provides us with pointers ,Swift There are no examples ...

  10. Swift3.0 The language tutorial uses strings to create and initialize strings

    Swift3.0 The language tutorial uses strings to create and initialize strings Swift3.0 The language tutorial uses strings to create and initialize strings , In programming languages , Literal value is a very common form of data description . People can express their meaning literally , Know its meaning , In especial ...

Random recommendation

  1. OHNL

    So let's see OGNL The concept of OGNL The full name of Object Graph Navigation Language. Object graph navigation language , It's an expression language . Using this expression language , You can use some kind of expression syntax , access J ...

  2. Android day 6 notes --ListView

    Android day 6 notes --ListView 1.AdapteView AdapteView Inherit ViewGroup Its essence is the container AdapterView Derived 3 A subclass : AbsListView AbsSpin ...

  3. type safe printf

    I saw it in the book , Below are : #include <iostream> #include <stdexcept> template<class T> struct is_ ...

  4. java Language to write the content of the document

    import java.io.File;import java.io.FileWriter;import java.io.IOException; public static void main(St ...

  5. EasyMock Use method and principle analysis

    from:http://www.ibm.com/developerworks/cn/opensource/os-cn-easymock/ Mock Method is a common technique in unit testing , Its main function is to simulate a ...

  6. ngnix apache tomcat Cluster load balancing configuration

    http://w.gdu.me/wiki/Java/tomcat_cluster.html Reference resources : Tomcat And Apache or Nginx Cluster load balancing settings for : http://huangrs.blog. ...

  7. MapReduce- practice 1

      MR Advanced practice 1:  -file Distribute multiple documents [-file  Suitable for the scene ] The distribution is local , Small files -file The principle of distribution         run.sh file : Through multiple -file, Distribute multiple local files to Ha ...

  8. modify Mac File permissions of the system

    modify Mac File permissions of the system occasionally , Because of all kinds of needs Mac OS System users need to modify a system file , But a lot of times Mac OS The system will prompt you " Not enough authority ". Therefore, it is often impossible to protect . Edit even ...

  9. FORM Call in JAVA Components

    Call mode : link : You can create a special Bean Area term , Use Implementation Class Features are linked to J a v a B e a n, Use W h e n - C u s t ...

  10. web Wechat development summary

    These two days use Django Developed web WeChat , It realizes the functions of displaying contacts and sending and receiving messages . Summarize some knowledge used in this process . 1 http request adopt chrome The browser's own developer tool checks the information requested each time , Analysis request , package ...