Inventory Service Integration
Overview
| Attribute |
Value |
| Context |
Inventory Service |
| Pattern |
Conformist |
| Direction |
Inbound (Inventory β Process Path) |
| Protocol |
Apache Kafka + REST API |
| Topics |
inventory.allocation.* |
Integration Summary
Inventory Service provides item properties and location data that Process Path uses for routing decisions. Process Path conforms to Inventoryβs data model for item characteristics like dimensions, weight, hazmat classification, and sortability.
1
2
3
4
5
6
7
8
| βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ
β INVENTORY SERVICE β β PROCESS PATH β
β β β β
β β’ Item master data β ββββββΊ β β’ Path eligibility β
β β’ Allocation tracking β Event β β’ Dimension checks β
β β’ Location info β β β’ Weight routing β
β β’ Lot/Serial tracking β β β’ Hazmat handling β
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ
|
Events Consumed
InventoryAllocatedEvent
Purpose: Provides item properties for path eligibility decisions
Topic: inventory.allocation.completed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| {
"specversion": "1.0",
"type": "com.paklog.inventory.allocated.v1",
"source": "/inventory-service",
"id": "evt-alloc-123456",
"time": "2025-01-20T09:56:00.000Z",
"subject": "SHP-123456",
"data": {
"shipmentId": "SHP-123456",
"orderId": "ORD-789012",
"allocations": [
{
"sku": "SKU-WIDGET-001",
"quantity": 2,
"warehouseLocation": {
"warehouse": "WH-001",
"zone": "ZONE-A",
"aisle": "A-12",
"bay": "B-03",
"shelf": "S-02",
"bin": "BIN-045"
},
"itemProperties": {
"weight": 1.2,
"dimensions": {
"length": 6,
"width": 4,
"height": 3
},
"fragilityLevel": "FRAGILE",
"sortabilityClass": "SORTABLE",
"hazmatClass": null,
"temperatureRequirement": null
},
"lotNumber": "LOT-2025-001",
"expirationDate": null
}
],
"allocationCompleteAt": "2025-01-20T09:56:00Z"
}
}
|
InventoryShortageEvent
Purpose: Handle allocation failures
Topic: inventory.allocation.shortage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| {
"type": "com.paklog.inventory.shortage.v1",
"data": {
"shipmentId": "SHP-123456",
"orderId": "ORD-789012",
"shortageItems": [
{
"sku": "SKU-WIDGET-001",
"requestedQuantity": 2,
"availableQuantity": 0
}
],
"shortageAt": "2025-01-20T09:56:00Z"
}
}
|
REST API Queries
Get Item Properties
Used for on-demand item property lookup when event data is incomplete.
Endpoint: GET /api/v1/inventory/items/{sku}/properties
Response:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| {
"sku": "SKU-WIDGET-001",
"weight": 1.2,
"dimensions": {
"length": 6,
"width": 4,
"height": 3
},
"fragilityLevel": "FRAGILE",
"sortabilityClass": "SORTABLE",
"hazmatClass": null,
"temperatureRequirement": null,
"specialHandling": []
}
|
Get Availability
Used for capacity planning and surge detection.
Endpoint: GET /api/v1/inventory/availability/{sku}
Path Eligibility Rules
Process Path applies these rules based on Inventory data:
Dimension Rules
| Condition |
Singles Path |
AFE Path |
Batch/Flow |
| Max dimension β€ 18β |
β
Eligible |
β
Eligible |
β
Eligible |
| Max dimension > 18β |
β
Eligible |
β Large tray only |
β
Eligible |
| Max dimension > 24β |
β
Eligible |
β Ineligible |
β
Eligible |
Weight Rules
| Condition |
Singles Path |
AFE Path |
Batch/Flow |
| Weight β€ 20 lbs |
β
Eligible |
β
Eligible |
β
Eligible |
| Weight 20-50 lbs |
β
Eligible |
β οΈ Large tray |
β
Eligible |
| Weight > 50 lbs |
β
Special handling |
β Ineligible |
β
Special handling |
Hazmat Rules
| Hazmat Class |
Singles Path |
AFE Path |
Batch/Flow |
| None |
β
Eligible |
β
Eligible |
β
Eligible |
| Class 1-9 |
β
Isolated |
β Ineligible |
β
Isolated |
| ORM-D |
β
Eligible |
β οΈ Separate |
β
Eligible |
Sortability Rules
| Class |
Singles Path |
AFE Path |
Batch/Flow |
| SORTABLE |
β
Eligible |
β
Eligible |
β
Eligible |
| NON_SORTABLE |
β
Eligible |
β Ineligible |
β
Eligible |
| SPECIAL |
β
Eligible |
β Ineligible |
β οΈ Special wave |
Data Mapping
| Inventory Field |
Process Path Field |
Transformation |
itemProperties.weight |
itemWeight |
Direct |
itemProperties.dimensions |
maxDimension |
max(L,W,H) |
itemProperties.fragilityLevel |
fragilityLevel |
Enum mapping |
itemProperties.sortabilityClass |
sortabilityClass |
Enum mapping |
itemProperties.hazmatClass |
hasHazmat |
null β false |
warehouseLocation.zone |
pickZone |
Zone mapping |
Caching Strategy
| Data |
Cache TTL |
Invalidation |
| Item properties |
1 hour |
On ItemUpdatedEvent |
| Location mappings |
15 min |
On LocationChangedEvent |
| Availability |
No cache |
Real-time query |
Error Handling
| Error |
Action |
Retry |
| Missing item properties |
Query REST API |
Yes (3x) |
| Invalid dimensions |
Use defaults, flag for review |
No |
| Unknown hazmat class |
Route to special handling |
No |
| Allocation shortage |
Wait for reallocation event |
Yes |
Anti-Corruption Layer
Process Path maintains an ACL to translate Inventory concepts:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| public class InventoryACL {
public ShipmentProperties translate(InventoryAllocatedEvent event) {
List<Allocation> allocations = event.getAllocations();
return ShipmentProperties.builder()
.itemCount(allocations.stream()
.mapToInt(Allocation::getQuantity).sum())
.totalWeight(allocations.stream()
.mapToDouble(a -> a.getItemProperties().getWeight()
* a.getQuantity()).sum())
.maxDimension(allocations.stream()
.flatMap(a -> Stream.of(
a.getItemProperties().getDimensions().getLength(),
a.getItemProperties().getDimensions().getWidth(),
a.getItemProperties().getDimensions().getHeight()))
.max(Double::compareTo).orElse(0.0))
.hasHazmat(allocations.stream()
.anyMatch(a -> a.getItemProperties().getHazmatClass() != null))
.fragilityLevel(aggregateFragility(allocations))
.sortabilityClass(aggregateSortability(allocations))
.build();
}
private FragilityLevel aggregateFragility(List<Allocation> allocations) {
// Most fragile item determines shipment fragility
return allocations.stream()
.map(a -> a.getItemProperties().getFragilityLevel())
.max(FragilityLevel::compareTo)
.orElse(FragilityLevel.STANDARD);
}
}
|
Monitoring
Key Metrics
process_path_inventory_events_received_total
process_path_inventory_api_calls_total
process_path_inventory_cache_hit_ratio
process_path_eligibility_check_duration_seconds
Alerts
- Inventory event processing lag > 5s
- API error rate > 5%
- Cache hit ratio < 80%