Pub/Sub Processor
Event-driven processor that consumes messages from Google Cloud Pub/Sub topics and sends them to external ERP systems.
Purpose
-
Consumes messages from Google Cloud Pub/Sub topics (optional, configurable)
-
Polls comerzzia database for pending documents
-
Validates and processes entity data
-
Sends data to ERP systems via HTTP
-
Supports concurrent processing with configurable parallel pull
-
Comprehensive retry logic with DLQ support
Prerequisites
This application requires an existing Google Cloud Pub/Sub setup. It does not include topic or subscription creation.
Ensure: - Google Cloud project is configured - Required topics and subscriptions are created (main and DLQ) - Service account credentials are available
Configuration
Application Settings
See application.yml for full configuration.
Key settings: - Project ID: Google Cloud project identifier - Topic configuration: Main topic and DLQ topic - Subscription configuration: Main subscription with credentials - Processing settings: Timeouts, retries, flow control - Retry configuration: Max attempts (default: 3) - Server configuration: Server port and context path - Actuator endpoints: Monitoring dashboard, metrics and health
Important Notes
-
Entity types must match those defined in
entities-config.ymlfrom Processor Common Library Module -
Flow control settings prevent message overload
Error Handling and Retry Logic
Retry Mechanism
-
First failure: Error registered in database, message republished to main topic with
retry-count=1 -
Subsequent failures: Message republished with incremented
retry-count -
Max retries reached: Message sent to DLQ topic and ACKed