Overview
This section explains the concept of Adapter Microservice, its architecture and data model. The design of Adapter Microservice is shown in the following.
Solution Overview
Adapter Microservice provides the flexibility to deploy API specific transformation and routing configurations for interface.
The functions represent a style of mediation functions supported through an Adapter microservice. Each of the functions provides API and event-based endpoints with flexible input and output schema supported. Each function represents an Operation supported in Adapter Microservice. These are generic adapter functions which can be used to support different patterns of integration required.
Adapter Microservice provides flexibility to support simple data transformation and API execution or File operations through CAMEL Spring XML configurations. Existing features can be enabled for multiple use cases just by defining the camel spring XML configuration.
There are three styles of adapter function:
- Execute API Function: Expose an Event-based interface where it executes one or more API on the target application. On success or failure of API execution, the API function generates a completion event. See Sample use case considered for usage of this pattern. (Refer: Execute API - Infinity MS Events)
- FileBasedIngestion: Expose GET API which provides GET API interface which will have mediation function to read the data file from a configured directory and provide data in the form of API response. (In Design phase)
- BulkingFunction: This function supports the collection of data in the form of events from the source system and stores in a staging data table. Further, Based on the schedule configuration, the schedule component reads data from the staging data table and produces data files on the target directory. (In Design phase)
The mediator engine uses configurations based routes to execute external API interfaces and File-based operations(read/write).
- Uses Camel Engine to do data transformation and API executions.
- Interfaces with target microservice or application (API, Filestore, streaming platform).
The MS framework provides inbox & outbox capability to support idempotency and supports transaction atomicity. Inbox & outbox listener services help to support event-based interfaces for API functions supported in Adapter microservice.
The MS framework infrastructure provides authorization policy support for implementing Role-based access control for these functions supported.
Configuration Microservice provided a centralized repository for configuring transformation and mediation rules for each of the functions supported. The mediator engine loads configurations dynamically from configuration microservice and executes data transformations and interface with the target application.
Data Model
The following entity relationship tables depict the details of the entities and the relationships between them.
|
Name |
Java Data type |
Remarks |
|---|---|---|
|
uuid |
java.lang.String |
Primary Key and Identifier of the sequence instance |
|
eventid |
java.lang.String |
correlation Id and Identifier of the sequence instance |
|
eventtype |
java.lang.String |
Identifier of the Eventtype, which event route to execute. |
|
status |
java.lang.String |
indicated the status of the given record NEW, INPROGRESS,COMPLETED |
|
payload |
java.lang.String |
Indicates the payload received. |
|
Name |
Java Data type |
Remarks |
|---|---|---|
|
eventId |
java.lang.String |
Primary Key Identifier of the event, Unique identifier (UUID) |
|
commandType |
java.lang.String |
Identifier of the Command type |
|
creationTime |
java.util.Date |
Indicates the creation time of event |
|
eventDetails |
java.lang.String |
Additional Event metadata (as name-value pair) |
|
eventSourceId |
java.lang.String |
Indicates source of event |
|
eventType |
java.lang.String |
Identifier of type of event |
|
organizationId |
java.lang.String |
Identifier of the Organization |
|
payload |
java.lang.String |
Payload data of the event |
|
priority |
java.lang.Integer |
Indicates event's Priority for delivery |
|
processedTime |
java.util.Date |
Indicates the processed time of event |
|
status |
java.lang.String |
Possible Values “NEW”, PROCESSED”, “FAILED” |
|
tenantId |
java.lang.String |
Identifier of the tenant |
|
userId |
java.lang.String |
Identifier of the user |
|
Name |
Java Data type |
Remarks |
|---|---|---|
|
eventId |
java.lang.String |
Primary Key Identifier of the event, Unique identifier (UUID) |
|
correlationId |
java.lang.String |
Identifier of the Command type |
|
creationTime |
java.util.Date |
Indicates the creation time of event |
|
eventDetails |
java.lang.String |
Additional Event metadata (as name-value pair) |
|
eventType |
java.lang.String |
Identifier of type of event |
|
eventDate |
java.util.Date |
Indicates the date of event |
|
organizationId |
java.lang.String |
Identifier of the Organization |
|
payload |
java.lang.String |
Payload data of the event |
|
priority |
java.lang.Integer |
Indicates event's Priority for delivery |
|
processedTime |
java.util.Date |
Indicates the processed time of event |
|
status |
java.lang.String |
Possible Values “NEW”, DELIVERED”, “FAILED” |
|
tenantId |
java.lang.String |
Identifier of the tenant |
|
userId |
java.lang.String |
Identifier of the user |
Use Case
The following shows executing process based on business events.
In this topic