Processor Common Library Module

Shared business logic, models, and utilities for all czz-to-erp-processor modules.

Purpose

This JAR library provides: - Entity configuration registry - Message processing services - HTTP client for ERP communication - Error tracking and reporting - Serialization/deserialization utilities - Common models and interfaces

Note: JAR library module - not executable on its own.

Key Components

Entity Registry

Centralizes entity configuration from entities-config.yml: - Entity types and names - Service bean mappings - ERP endpoint paths - Messaging configuration (topics, DLQ topics) - Scheduler configuration (cron expressions)

Messaging Architecture

  • Publishing interface for sending messages to different messaging systems

  • Dynamic scheduler for database polling with configurable cron schedules per entity

  • Base consumer implementation with built-in retry logic and error handling

  • Consumer activation is optional and configurable per application

Message Processing Services

Business logic for processing each entity type: - Ticket processing - Cash journal processing

HTTP Client

Handles communication with external ERP systems: - Configurable endpoint, authentication - JSON/XML format support - Error handling and retries

Error Tracking

IntegrationErrorService provides: - Persists errors to database - Marks successful processing - Full error context and correlation tracking

Serialization

CzzToErpSerializationService handles: - JSON serialization - XML serialization - Format selection based on configuration

Entities Configuration

The entities configuration is loaded from entities-config.yml.

Entities configuration example
entityregistry:
  entities:
    tickets:
      type: tickets
      name: Tickets
      entityService: ticketDocumentService
      erpEndpoint: /api/eticket
      topic: czz-to-erp-tickets
      dlqTopic: czz-to-erp-tickets-dlt
      schedulerCron: "0 0 12 * * ?"
      schedulerEnabled: true
    cashjournal:
      type: cashjournal
      name: Cash Journal
      entityService: cashJournalService
      erpEndpoint: /api/cashjournal
      topic: czz-to-erp-cashjournal
      dlqTopic: czz-to-erp-cashjournal-dlt
      schedulerCron: "0 0 12 * * ?"
      schedulerEnabled: true

Defines supported entities types and maps them to processing service beans.