Common Library
Shared Java library providing core abstractions, utilities, and infrastructure components for all ERP processor implementations (Folder, Kafka, Pub/Sub).
Purpose
Centralizes common functionality: - Eliminates code duplication across processor implementations - Provides standardized abstractions for message processing and error handling - Ensures consistency in configuration, entity management, and metrics collection - Facilitates maintenance through single source of truth
Note: JAR library module - not executable on its own.
Architecture
Template pattern approach - abstract base classes extended by implementations:
flowchart TD
subgraph Common["Processor Common Library"]
direction TB
A[Configuration<br/>Properties & Spring]
B[Abstract Base Classes<br/>EntityRegistry, MessageProcessor<br/>MetricsCollector, MonitorController]
C[Models & DTOs<br/>EntityType, Metadata]
D[Error Handling<br/>ErrorPublisher, ErrorMetadata]
end
E[Folder Processor]
F[Kafka Processor]
G[Pub/Sub Processor]
Common --> E
Common --> F
Common --> G
style Common fill:none,stroke:#666,stroke-width:3px
style A fill:none,stroke:#666,stroke-width:3px
style B fill:none,stroke:#666,stroke-width:3px
style C fill:none,stroke:#666,stroke-width:3px
style D fill:none,stroke:#666,stroke-width:3px
style E fill:none,stroke:#666,stroke-width:3px
style F fill:none,stroke:#666,stroke-width:3px
style G fill:none,stroke:#666,stroke-width:3px
Provided Resources
This module provides shared resources for all processor application modules to use:
Spring Context
All applications load comerzzia-*context.xml files in classpath for custom spring configuration.
Entities Configuration
The entities configuration is loaded from spring config configuration import property. The default value of ´spring.config.input´ is `classpath:entities-config.yml´.
erp-to-czz:
entities:
- type: items
name: Items
service-bean: erpToCzzItemService
- type: promotions
name: Promotions
service-bean: erpToCzzPromotionsService
- type: rates
name: Rates
service-bean: erpToCzzRatesService
- type: warehousestock
name: WarehouseStock
service-bean: erpToCzzWarehouseStockService
- type: sales
name: Sales
service-bean: erpToCzzSalesService
- type: salesfiles
name: SalesFiles
service-bean: erpToCzzSalesFilesService
- type: saleschannels
name: SalesChannels
service-bean: erpToCzzSaleschannelsService
- type: stores
name: Stores
service-bean: erpToCzzStoresService
Defines supported entities types and maps them to integration service beans from - Processor integration services.