Skip to content

Latest commit

 

History

History
75 lines (52 loc) · 2.74 KB

02_architecture.md

File metadata and controls

75 lines (52 loc) · 2.74 KB

Architecture

Fig. 1 class diagram

Implementation of ESB pattern was built on the top of middleware pattern (chain of executable classes). There are 6 core middlewares:

  • ValidatorMiddleware
  • ProcessingMiddleware
  • TransportMiddleware
  • SyncRecordsMiddleware
  • PostSuccessMiddleware
  • PostErrorMiddleware

All of them handled with Core class. Core could be supplemented with any additional Middlewares ContainerConfig.php:67

Main function - validate incoming data and go to next middleware. If validation can't be passed - throw error ValidationException

The goal of ProcessingMiddleware is to render content(by TWIG), which was set in 'template' section of config, prevent duplicate request(if option was set through route config), update ProcessingData with TargetRequest. If duplicate call detected, will throw DuplicateRecordException

Will add authorization data to TargetRequest via AuthServicePool if auth config was set. Main goal - to send content, of TargetRequest to dedicated system via ClientPool. As result, will supplement ProcessingData with TargetResponse, which contain response of outer system.

If syncSettings config is set, will store processed data to control further duplicate request

Will be called only if TransportMiddleware was successive. Will run chain of handlers, dedicated to Route. Goal of SuccessHandlers is further processing of message after success call(outer requests, fire events, store something, etc)

Will process message through PostErrorHandlersPool, dedicated to Route. Will throw NonSuccessException in a result