Integration Patterns - pratchaya-maneechot/service-exchange GitHub Wiki
Usage: Task Management ↔ Bidding & Negotiation
Both contexts share the same Task entity model as they need identical understanding of task structures.
// Shared Task aggregate
interface Task {
id: TaskId;
title: string;
description: string;
budget: MonetaryAmount;
status: TaskStatus;
location: Location;
requirements: TaskRequirement[];
}
Payment (Supplier) → Review (Customer)
- Payment completion enables review process
- Event:
PaymentCompleted
→EnableReviewProcess
Task (Supplier) → Notification (Customer)
- Task events trigger notifications
- Event:
TaskCreated
→NotifyRelevantTaskers
All Contexts → User & Identity Context
- All services conform to User context's identity model
- Shared user representation across system
User Context ↔ Review Context
- Bidirectional dependency
- User reputation affects profile, reviews affect user standing
Payment Context → External Payment Gateways
- Standardized interface for multiple payment providers
- Anti-corruption layer for external systems
Pattern | From Service | To Service | Communication Type |
---|---|---|---|
Event-Driven | Task | Notification | Async (Kafka) |
Event-Driven | Payment | Review | Async (Kafka) |
Event-Driven | Bidding | Payment | Async (Kafka) |
Synchronous | All Services | User & Identity | Sync (REST) |
Synchronous | Task | Location | Sync (REST) |