ARCP 0001: Standard Microservice and Converter Blueprint
Author: Emir Boyacı
What the Pattern Is
Section titled “What the Pattern Is”The Standard Microservice and Converter Blueprint defines the canonical project layout, dependency inheritance, request validation, schema mapping, and downstream client conventions across the three AirCommerce backend runtime tiers:
- Versioned NDC Converter Services (
service-converter-ndc24,service-converter-ndc192): Authenticate external requests via Core Library, validate inbound NDC XML/JSON payloads, perform pure schema conversion between IATA NDC models andmodel-one-order, and delegate to the Business Orchestrator. - Business Orchestrator Service (
service-business-orchestrator): Executes stateless retailing business rules (fare bundling, price-class enrichment, channel/tour-operator resolution) overmodel-one-orderDTOs using dynamic tenant parameters from Configuration Util. - External PSS Connectors (
service-connector-iflyres): Perform pure schema and protocol conversion betweenmodel-one-orderand external PSS SOAP/HTTP models (model-pss-iflyres), translating SOAP faults and HTTP errors into canonical exceptions.
When to Use It
Section titled “When to Use It”Use this pattern whenever scaffolding a new microservice or implementing a vertical capability slice (such as OrderRetrieve/OrderView, AirShopping, OfferPrice, or OrderCreate) across Converter, Orchestrator, or Connector repositories.
Rules an Interface Must Follow
Section titled “Rules an Interface Must Follow”1. Maven Inheritance & Dependency Scope
Section titled “1. Maven Inheritance & Dependency Scope”- Every microservice
pom.xmlMUST inherit fromone.aircommerce.pom:boot-base-super-pom(ADR 0005). - Do not redeclare dependencies already provided by Core Library (
spring-boot-starter-webmvc,spring-cloud-starter-openfeign,spring-boot-starter-oauth2-resource-server,lombok) or Test Support Library (wiremock-spring-boot,testcontainers). - Declare only tier-specific schema artifacts (
model-one-order,model-ndc24,model-ndc192, ormodel-pss-iflyres) andone.aircommerce.util:configuration-util.
2. Canonical Package Structure
Section titled “2. Canonical Package Structure”All microservices follow the root package convention one.aircommerce.service.<tier>.<name>:
one.aircommerce.service.<tier>.<name>├── client/ # OpenFeign interfaces for downstream service or SOAP communication├── config/ # ConfigBean (@ConfigurationValue fields), CustomGlobalExceptionHandler, Feign decoders├── constant/ # ErrorConstant enums and domain constants├── controller/ # REST controllers (@RestController)├── exception/ # Tier-specific exceptions extending ServiceException├── mapper/ # Pure mapper interfaces and implementations ( + mapper/util/ helpers)├── service/ # Use-case interfaces and service/impl/ implementations└── validation/ # Request validators and @ValidateNDCRequest aspect (in Converter services)3. Controller & Media-Type Conventions
Section titled “3. Controller & Media-Type Conventions”- Converter Controllers (
service-converter-ndc*) MUST consume and produce bothMediaType.APPLICATION_XML_VALUEandMediaType.APPLICATION_JSON_VALUEon their@RequestMappingendpoints so aggregators can transact in either XML or JSON. - Internal Controllers (
service-business-orchestratorandservice-connector-iflyres) exchangemodel-one-orderJSON payloads wrapped in or aligned withBaseResponse/ServiceExceptioncontracts from Core Library.
4. Aspect-Driven Request Validation (@ValidateNDCRequest)
Section titled “4. Aspect-Driven Request Validation (@ValidateNDCRequest)”- In
service-converter-ndc*, structural and format validation of inbound NDC payloads is triggered declaratively via@ValidateNDCRequest(ValidationAspect+ValidatorRegistry+ operation-specificNDCRequestValidator<T>implementations) before mapper execution. - Business rules that depend on tenant configuration or PSS state belong in
service-business-orchestrator, never inside Converter validators or Connector mappers.
5. Pure Mapper Isolation
Section titled “5. Pure Mapper Isolation”- Converters (
service-converter-ndc*) and Connectors (service-connector-iflyres) MUST implement strictly pure field and structure mappings as documented in the Architecture Portal’s Schema Mappings (x-ndc24,x-ndc192, andx-external). - Mappers are stateless Spring
@Componentclasses (<Operation>Mapper/<Operation>MapperImpl) backed by focused utility classes (TimezoneUtils,DataUtil) and deterministic unit tests.
6. Dynamic Configuration & Exception Handling
Section titled “6. Dynamic Configuration & Exception Handling”- Dynamic tenant properties are injected into
ConfigBeanusing@ConfigurationValuefrom Configuration Util with safe local fallback defaults (ADR 0003). - Each service defines a
CustomGlobalExceptionHandlerextendingGlobalExceptionHandlerfrom Core Library to translate tier-specific faults (e.g.,IFlyResSoapFaultExceptionorNotValidRequestException) into standardized error responses. - Controller and client integration tests extend
BaseControllerTestfrom Test Support Library and stub downstream HTTP/SOAP calls using WireMock fixtures undersrc/test/resources/wiremock/.