Skip to content

paklog/cross-docking-operations

Repository files navigation

Cross-Docking Operations

Direct transfer workflows, flow-through processing, and intelligent cross-dock matching without storage, enabling rapid hub-and-spoke distribution and merge-in-transit operations.

Overview

The Cross-Docking Operations service is a critical component of the Paklog WMS/WES platform, enabling efficient direct transfer of goods from inbound to outbound shipments without intermediate storage. Cross-docking can reduce handling costs by 20-30%, decrease order cycle time by 40%, and minimize inventory holding costs, making it essential for time-sensitive and high-velocity distribution operations.

This service implements sophisticated algorithms for cross-dock matching, load consolidation, and flow-through processing. By eliminating storage steps and coordinating tightly synchronized inbound/outbound schedules, cross-docking maximizes facility throughput while minimizing touch points and cycle time.

Domain-Driven Design

Bounded Context

The Cross-Docking Operations bounded context is responsible for:

  • Cross-dock opportunity identification and matching
  • Direct transfer workflow orchestration
  • Flow-through processing coordination
  • Load consolidation and deconsolidation
  • Cross-dock performance optimization
  • Hub-and-spoke distribution management
  • Merge-in-transit operations
  • Cross-dock timing window management

Ubiquitous Language

  • Cross-Dock: Direct transfer of goods from receiving to shipping without storage
  • Flow-Through: Items moving directly through the facility
  • Transfer Order: Instruction to move items from inbound to outbound
  • Cross-Dock Match: Pairing of inbound receipt with outbound shipment
  • Consolidation: Combining multiple inbound loads into single outbound
  • Deconsolidation: Splitting inbound load to multiple outbound destinations
  • Cross-Dock Window: Time period for completing direct transfer
  • Staging Lane: Temporary holding area for cross-dock items
  • Hub-and-Spoke: Distribution model with central hub facility
  • Merge-in-Transit: Combining shipments from multiple origins
  • Touch Point: Each handling event for cross-dock items
  • Flow Rate: Velocity of items through cross-dock operation

Core Domain Model

Aggregates

CrossDockOperation (Aggregate Root)

  • Manages complete cross-dock workflow lifecycle
  • Validates feasibility and timing constraints
  • Coordinates inbound/outbound synchronization
  • Enforces cross-dock business rules

TransferOrder

  • Represents movement from inbound to outbound
  • Tracks transfer execution and status
  • Manages item quantities and conditions
  • Links inbound receipts to outbound shipments

ConsolidationPlan

  • Defines strategy for combining loads
  • Optimizes load building and routing
  • Manages consolidation timing windows
  • Tracks consolidation efficiency metrics

StagingLane

  • Manages temporary cross-dock staging area
  • Tracks capacity and occupancy
  • Enforces staging time limits
  • Coordinates lane assignment

Value Objects

  • CrossDockType: DIRECT, CONSOLIDATED, DECONSOLIDATED, MERGE_IN_TRANSIT
  • TransferWindow: Time constraints for cross-dock completion
  • CrossDockPriority: Urgency level for transfer execution
  • FlowThroughRate: Items per hour throughput
  • TouchCount: Number of handling events
  • MatchQuality: Confidence score for cross-dock pairing
  • StagingDuration: Time items spend in staging
  • TransferStatus: MATCHED, IN_PROGRESS, COMPLETED, FAILED

Domain Events

  • CrossDockOpportunityIdentifiedEvent: Potential match found
  • CrossDockMatchedEvent: Inbound paired with outbound
  • TransferOrderCreatedEvent: Direct transfer initiated
  • StagingLaneAssignedEvent: Staging location allocated
  • TransferStartedEvent: Movement began
  • TransferCompletedEvent: Cross-dock finished
  • CrossDockWindowExpiredEvent: Time window missed
  • ConsolidationCompletedEvent: Load building finished
  • FlowThroughAchievedEvent: No-touch transfer completed

Architecture

This service follows Paklog's standard architecture patterns:

  • Hexagonal Architecture (Ports and Adapters)
  • Domain-Driven Design (DDD)
  • Event-Driven Architecture with Apache Kafka
  • CloudEvents specification for event formatting
  • CQRS for command/query separation

Project Structure

cross-docking-operations/
├── src/
│   ├── main/
│   │   ├── java/com/paklog/crossdocking/operations/
│   │   │   ├── domain/               # Core business logic
│   │   │   │   ├── aggregate/        # CrossDockOperation, TransferOrder
│   │   │   │   ├── entity/           # Supporting entities
│   │   │   │   ├── valueobject/      # CrossDockType, TransferWindow, etc.
│   │   │   │   ├── service/          # Domain services
│   │   │   │   ├── repository/       # Repository interfaces (ports)
│   │   │   │   └── event/            # Domain events
│   │   │   ├── application/          # Use cases & orchestration
│   │   │   │   ├── port/
│   │   │   │   │   ├── in/           # Input ports (use cases)
│   │   │   │   │   └── out/          # Output ports
│   │   │   │   ├── service/          # Application services
│   │   │   │   ├── command/          # Commands
│   │   │   │   └── query/            # Queries
│   │   │   └── infrastructure/       # External adapters
│   │   │       ├── persistence/      # MongoDB repositories
│   │   │       ├── messaging/        # Kafka publishers/consumers
│   │   │       ├── web/              # REST controllers
│   │   │       └── config/           # Configuration
│   │   └── resources/
│   │       └── application.yml       # Configuration
│   └── test/                         # Tests
├── k8s/                              # Kubernetes manifests
├── docker-compose.yml                # Local development
├── Dockerfile                        # Container definition
└── pom.xml                          # Maven configuration

Features

Core Capabilities

  • Intelligent Matching: AI-powered pairing of inbound/outbound shipments
  • Flow-Through Processing: Zero-touch direct transfers
  • Load Consolidation: Optimal combining of multiple inbound sources
  • Time Window Management: Tight synchronization of inbound/outbound timing
  • Staging Optimization: Minimal staging area utilization
  • Hub-and-Spoke Coordination: Multi-location cross-dock orchestration
  • Performance Analytics: Real-time cross-dock efficiency metrics
  • Exception Management: Automated handling of timing conflicts

Advanced Features

  • Predictive cross-dock opportunity identification
  • Multi-stop route optimization for consolidated loads
  • Dynamic staging lane assignment
  • Real-time capacity planning
  • Cross-dock simulation and what-if analysis
  • Automated cross-dock feasibility validation
  • Integration with yard management for dock coordination
  • Temperature-controlled cross-dock support

Technology Stack

  • Java 21 - Programming language
  • Spring Boot 3.2.5 - Application framework
  • MongoDB - Cross-dock operation persistence
  • Redis - Real-time matching cache
  • Apache Kafka - Event streaming
  • CloudEvents 2.5.0 - Event format specification
  • Resilience4j - Fault tolerance
  • Micrometer - Metrics collection
  • OpenTelemetry - Distributed tracing

Getting Started

Prerequisites

  • Java 21+
  • Maven 3.8+
  • Docker & Docker Compose
  • MongoDB 7.0+
  • Redis 7.2+
  • Apache Kafka 3.5+

Local Development

  1. Clone the repository
git clone https://github.com/paklog/cross-docking-operations.git
cd cross-docking-operations
  1. Start infrastructure services
docker-compose up -d mongodb redis kafka
  1. Build the application
mvn clean install
  1. Run the application
mvn spring-boot:run
  1. Verify the service is running
curl http://localhost:8095/actuator/health

Using Docker Compose

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f cross-docking

# Stop all services
docker-compose down

API Documentation

Once running, access the interactive API documentation:

Key Endpoints

Cross-Dock Matching

  • POST /api/v1/cross-dock/match - Find cross-dock opportunities
  • GET /api/v1/cross-dock/opportunities - List potential matches
  • POST /api/v1/cross-dock/confirm - Confirm cross-dock operation
  • DELETE /api/v1/cross-dock/{operationId}/cancel - Cancel cross-dock

Transfer Management

  • POST /api/v1/transfers - Create transfer order
  • GET /api/v1/transfers/{transferId} - Get transfer details
  • PUT /api/v1/transfers/{transferId}/execute - Execute transfer
  • GET /api/v1/transfers/active - List active transfers

Consolidation

  • POST /api/v1/consolidation/plan - Create consolidation plan
  • GET /api/v1/consolidation/{planId} - Get consolidation details
  • POST /api/v1/consolidation/{planId}/build - Execute load building

Analytics

  • GET /api/v1/analytics/flow-through-rate - Flow-through percentage
  • GET /api/v1/analytics/touch-count - Average touch points
  • GET /api/v1/analytics/cycle-time - Cross-dock cycle time

Configuration

Key configuration properties in application.yml:

crossdocking:
  operations:
    matching:
      auto-match-enabled: true
      match-threshold-score: 0.85
      max-staging-hours: 4

    windows:
      default-window-hours: 2
      minimum-window-minutes: 30
      maximum-window-hours: 24

    staging:
      max-lanes: 50
      lane-capacity-pallets: 10
      lane-utilization-target: 0.75

    performance:
      target-flow-through-rate: 0.90
      max-touch-points: 2
      target-cycle-time-hours: 2

Event Integration

Published Events

  • CrossDockOpportunityIdentifiedEvent - Potential match found
  • CrossDockMatchedEvent - Inbound/outbound paired
  • TransferOrderCreatedEvent - Transfer initiated
  • TransferCompletedEvent - Transfer finished
  • ConsolidationCompletedEvent - Load consolidated
  • CrossDockWindowExpiredEvent - Timing missed
  • FlowThroughAchievedEvent - Zero-touch success

Consumed Events

  • InboundReceiptEvent from Receiving (cross-dock source)
  • OutboundShipmentEvent from Shipping (cross-dock destination)
  • DockDoorAssignedEvent from Yard Management (dock coordination)
  • AppointmentScheduledEvent from Yard Management (timing sync)

Deployment

Kubernetes Deployment

# Create namespace
kubectl create namespace paklog-crossdock

# Apply configurations
kubectl apply -f k8s/deployment.yaml

# Check deployment status
kubectl get pods -n paklog-crossdock

Production Considerations

  • Scaling: 3-5 replicas for high availability
  • High Availability: Multi-zone deployment
  • Resource Requirements:
    • Memory: 1 GB per instance
    • CPU: 0.5 core per instance
  • Monitoring: Prometheus metrics at /actuator/prometheus

Testing

# Run unit tests
mvn test

# Run integration tests
mvn verify

# Run with coverage
mvn clean verify jacoco:report

Test Coverage Requirements

  • Unit Tests: >80%
  • Integration Tests: >70%
  • Domain Logic: >90%

Performance

Benchmarks

  • Match Generation: <100ms per opportunity
  • Transfer Execution: <500ms per transfer
  • Flow-Through Rate: >90% for eligible items
  • Cross-Dock Cycle Time: <2 hours average
  • Touch Points: <2 per item average
  • Staging Utilization: 70-80% optimal

Optimization Techniques

  • Redis caching for active matches
  • Async matching algorithms
  • Connection pooling
  • Batch transfer processing
  • Pre-computed consolidation plans

Monitoring & Observability

Metrics

  • Flow-through percentage
  • Average touch count
  • Cross-dock cycle time
  • Staging lane utilization
  • Match success rate
  • Window adherence percentage

Health Checks

  • /actuator/health - Overall health
  • /actuator/health/liveness - Kubernetes liveness
  • /actuator/health/readiness - Kubernetes readiness
  • /actuator/health/mongodb - Database connectivity

Distributed Tracing

OpenTelemetry integration tracking items from receipt to shipment.

Business Impact

  • Handling Cost: -25% reduction through fewer touches
  • Cycle Time: -40% faster order-to-ship time
  • Storage Cost: -100% for cross-docked items (zero storage)
  • Labor Efficiency: +30% through streamlined workflows
  • Throughput: +50% facility capacity with same footprint
  • Flow-Through Rate: 85-95% for eligible items
  • Customer Service: -2 days average lead time reduction

Troubleshooting

Common Issues

  1. Low Match Rate

    • Review matching algorithm parameters
    • Check inbound/outbound timing alignment
    • Verify product eligibility criteria
    • Examine consolidation opportunities
  2. Window Expiration

    • Analyze staging duration patterns
    • Review transfer execution times
    • Check dock door availability
    • Verify labor capacity
  3. Staging Congestion

    • Review lane assignment strategy
    • Check staging time limits enforcement
    • Verify transfer order priorities
    • Analyze flow-through bottlenecks
  4. High Touch Count

    • Review cross-dock workflow design
    • Check for unnecessary intermediate steps
    • Verify direct transfer routing
    • Analyze staging requirements

Contributing

  1. Follow hexagonal architecture principles
  2. Maintain domain logic in domain layer
  3. Keep infrastructure concerns separate
  4. Write comprehensive tests for all changes
  5. Document domain concepts using ubiquitous language
  6. Follow existing code style and conventions

Support

For issues and questions:

  • Create an issue in GitHub
  • Contact the Paklog team
  • Check the documentation

License

Copyright 2024 Paklog. All rights reserved.


Version: 1.0.0 Phase: 2 (Optimization) Priority: P1 (High) Maintained by: Paklog Cross-Dock Operations Team Last Updated: November 2024

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •