WSO2 ITALIA SMART TALK 2023 #8
ASYNCHRONOUS API. STREAMING AND EVENT DRIVEN ARCHITECTURE.
Unisciti al Gruppo Linkedin WSO2 ITALIA CLUB e scopri come avere un digital business di successo.
Scrivi a sales@profesia.it per conoscere Profesia, polo innovativo del Gruppo Lynx
3. QUANDO CHI COSA
1 marzo GabrieleGianoglio
weModI e Interoperabilità dellePA:da un
Comune all'Europa èsolo questionedi API
15 marzo Matteo Bordin Novità WSO2 APIM
29 marzo Matteo Bordin Novità WSO2 IS
19 aprile
Stefano
Negri (WSO2)
TELCO success story
3 maggio Matteo Bordin
Apification:opportunità
delleorganizzaioni modernenella post-
digitalizzazione
17 maggio DanieleDal Farra
Autenticazione user centric:identità digitali
e modelli passwordless
31 maggio GabrieleGianoglio InstallareWSO2 in AWS: tips and tricks
28 giugno Danilo Massaglia API Asincrone
12 luglio Leo Antonaccio
Un Caso reale: Identity Management
integrato con SPID
26 luglio DanieleDal Farra Un Caso reale: API exposition nel mondo Finance
4. Lo speaker di oggi...
4
DaniloMassaglia
Lui in 3 parole: Preciso,empatico e paziente
Per noi è:
Paziente, empatico,
affidabile
5. data
AsyncAPI, Streaming and Event-Driven Architectures
AsynchronousAPIs allow you to stream data, send multiple requests at the same time, and
manage communicationintelligentlybetween services, while synchronous APIs require
you to make a new request every time you need data.
Differences between asynchronous and synchronous APIs
SynchronousAPIs often use HTTP or HTTPS for transport, and HTTP is a unidirectional
protocol. The client sends a request to the server, and then the server sends an HTTP or
HTTPS response back. Asynchronous APIs tend to use bidirectionalprotocolslike HTTP/2.
When you use a bidirectionalprotocol, the client and server can maintaintheir
connection, sending and receiving data for as long as they need to. You can think of it like
this: when you make a synchronous request, you pull data from a server, but you can use
an asynchronousrequest to ask the server to push the latest data to you.
6. data
AsyncAPI, Streaming and Event-Driven Architectures
AsynchronousMessage Processing
Asynchronousmessaging is a communicationmethod wherein the system puts a message
in a message queue and does not require an immediate response to continue processing.
Asynchronousmessaging is useful for the following:
• Delegate the request to some external system for processing
• Ensure delivery of a message to an external system
• Throttle message rates between two systems
• Batch processing of messages
7. data
AsyncAPI, Streaming and Event-Driven Architectures
Streaming APIs in WSO2
API Manager
In addition to REST/SOAP compatibility, WSO2 API Manager 4.2 now offers first-class
supportfor streaming APIs.
Now, it is possibleto expose an event stream as a managed API with all the
necessaryQuality of Services (QoS),such as applying security, rate-limiting, and
analytics.
Streaming APIs are used within an event-driven architecture (EDA) in order to support
real-time/near real-time experiences.Applications orservers that produce events,
publish those events to certain topics.The clients who are interested in the specific
type of events subscribe to the topic(s) corresponding to those events, which enables
them to receive events as they are published to the topics without separately sending
a request.
8. data
AsyncAPI, Streaming and Event-Driven Architectures
Streaming APIs in WSO2
API Manager
Event Driven Architecture (EDA) allows changes to data and state, and interesting business events
to be pushed to applications immediatelywithout requiring the applications to poll for the updates.
Organizations try to embrace EDA to modernize their applications with rich, interactive, and
immediate user experience (e.g., immediatelyseeing the changes in the stockprices).
In addition to EDA,you also need to manage streaming APIs in scenarios when an organization
needs to expose their event-streams in a managed way, to generate money based on streaming
data, or to only allow authorized clients to access certain APIs.
However, organizations face multiple challenges, as listed below, when attempting to implementan
event driven architecture or introduce eventing.
• Integrating existing applications with the event backbone.
• Exposing event streams to web applications and external users.
• New applications need to be modifiedto deal with the transport level concerns.
• Integrating persistentdata stores in a streaming manner.
• Processing event streams.
15. data
AsyncAPI, Streaming and Event-Driven Architectures
Value addition with Streaming APIs
In orderto utilize a streaming API in a modern-day practical scenario, a strong API
management platform is required.
This is to facilitate more advanced requirements such as security, throttling, monetization, and
analytics since it is more challenging to accomplishthese features for streaming APIs rather
than for conventional REST APIs.
WSO2 API Manager provides the ability to create a streaming API from scratch or use an
existing AsyncAPI specificationto create the API in the gateway and improve the quality of
service.
In addition to the substantial amount of features,the user/developerexperienceis of great
importance since it makes the tasks more intuitive, ultimately providing new users an efficient
platform to becomefamiliarized with the system in a short period of time.
16. data
AsyncAPI, Streaming and Event-Driven Architectures
Conclusion
Synchronous APIs are ideal for many scenarios — particularly if you need an instant response.In other
cases,when clients need to be informed of events or the processing required forthe responsehappens at a
differenttime, ordinary synchronous messaging becomes trickyand event-driven APIs can aptly address
such needs.
EDA is flexible enough that you can start with simple notifications,or combine two-way event communication
with a synchronous approach to deliver an optimal architecture. So, using an event-driven designalongside
a traditional request/responsedesignforyour APIs brings the bestof both worlds to build highly scalable and
reactive web applications.Furthermore, combining traditional API management capabilities with an event-
driven architecture provides tremendous value additions to expand business reach and adoption.