Skip to main contentIBM Garage Event-Driven Reference Architecture - Reefer Container Shipment reference implementation

Event Details

This section details all of the events being used in the Reefer Container Shipment reference implementation and the relationship of each event to the application's microservices.

Order Command Event

Description: These events are produced as a result of user interaction through the User Interface. These events will command the creation, update or cancellation of a shipping order. In EDA space, a command is an action demanded or triggered by an actor. These events are of important relevance in the Consume-transform-produce loop pattern.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"payload": {
"customerID": "FishFarm",
"destinationAddress": {
"city": "Oakland",
"country": "USA",
"state": "CA",
"street": "100 Main street",
"zipcode": "95053"

Order Created Event

Description: These events are produced as a result of a new shipping order being created. These events are emitted in order to inform any other component of the overall Reefer Container Shipment solution such as the Containers and Voyage components, that are part of the Saga pattern pattern to find a container and a voyage to get allocated and assigned, or the Order Query component, that will track the status of the orders and containers for the query part of the Command Query Responsibility Segregation (CQRS) pattern for the overall solution.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"payload": {
"customerID": "FishFarm",
"destinationAddress": {
"city": "Oakland",
"country": "USA",
"state": "CA",
"street": "100 Main street",
"zipcode": "95053"

Order Updated Event

Description: These events are produced as a result of a shipping order being updated. These events are emitted in order to inform any other component of the overall Reefer Container Shipment solution such as the Containers and Voyage components, that are part of the Saga pattern pattern to find a container and a voyage to get allocated and assigned, or the Order Query component, that will track the status of the orders and containers for the query part of the Command Query Responsibility Segregation (CQRS) pattern for the overall solution.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"payload": {
"customerID": "FishFarm",
"destinationAddress": {
"city": "Oakland",
"country": "USA",
"state": "CA",
"street": "100 Main street",
"zipcode": "95053"

Order Spoilt Event

Description: These events denote that a container, which is carrying fresh goods from a source port to a destination port, has spoilt these fresh goods due to an anomaly detected by one or more of its IOT sensors.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"orderID": "85eb9236-ed11-4ba5-b4ec-055cb261ae6d",
"payload": {
"containerID": "8919",
"orderID": "85eb9236-ed11-4ba5-b4ec-055cb261ae6d"
},
"timestamp": 1588010710172,
"type": "OrderSpoilt"
}

Order Reject Event

Description: These events are produced as a result of receiving a Container Not Found Event or Voyage Not Found Event as part of the Saga pattern pattern and will trigger a compensation process for the components in that Saga pattern pattern.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"payload": {
"customerID": "FishFarm",
"destinationAddress": {
"city": "Oakland",
"country": "USA",
"state": "CA",
"street": "100 Main street",
"zipcode": "95053"

Order Cancel Event

Description: These events are produced as a result of a user/administrator demanding/requesting the cancellation of a shipping order. These events will trigger the process described in the Order Cancellation pattern.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"payload": {
"containerID": "1392",
"customerID": "FishFarm",
"destinationAddress": {
"city": "Oakland",
"country": "USA",
"state": "CA",
"street": "100 Main street",

Error Event

Description: These events are produced as a result of any error that occurs in the Order Command component.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events: None

Patterns these events are relevant to: None

Data Schema: Error Event Schema

Example:

{
"errorMessage" : "Repository access issue",
"payload": {
"containerID": "1392",
"customerID": "FishFarm",
"destinationAddress": {
"city": "Oakland",
"country": "USA",
"state": "CA",

Container Added Event

Description: These events would make the Containers component to create a new container and add it to the container inventory it manages.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

  • Command Query Responsibility Segregation (CQRS)

Example:

{
"containerID": "8919",
"payload": {
"brand": "itgtests-brand",
"capacity": 100,
"containerID": "8919",
"latitude": 31.4,
"longitude": 121.5,
"status": "Empty",

Container Assigned Event

Description: These messages denote that a container has been assigned to a shipping order as this container suited the quantity and source port of the shipping order.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

  • Command Query Responsibility Segregation (CQRS)

Example:

{
"containerID": "8919",
"payload": {
"containerID": "8919",
"orderID": "85eb9236-ed11-4ba5-b4ec-055cb261ae6d"
},
"timestamp": 1588010526382,
"type": "ContainerAssignedToOrder"
}

Container Allocated Event

Description: These events denote that a container, to carry the amount of fresh goods and from the source port specified in the shipping order, has been found and allocated to a shipping order, and viceversa, as part of the Saga pattern pattern for a long running transaction. These events are emitted by the Containers component.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"orderID": "85eb9236-ed11-4ba5-b4ec-055cb261ae6d",
"payload": {
"containerID": "8919",
"orderID": "85eb9236-ed11-4ba5-b4ec-055cb261ae6d"
},
"timestamp": 1588010526294,
"type": "ContainerAllocated"
}

Container Not Found Event

Description: These events denote that a container to carry the amount of fresh goods from the source port specified in a new shipping order could not be found. As a result, the new shipping order will become rejected.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"orderID": "b00a3d0f-c9f9-4cbd-a6ea-36b8b455c489",
"payload": {
"orderID": "b00a3d0f-c9f9-4cbd-a6ea-36b8b455c489",
"reason": "A container could not be found for this order"
},
"timestamp": 1588010563033,
"type": "ContainerNotFound"
}

Container Telemetry Event

Description: These events are produced by the Telemetry Simulator to simulate the container’s IOT sensor telemetries that are then consumed by the Anomalous Container Scoring component for the Container Anomaly pattern.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"containerID": "1111",
"payload": "(1111, 2020-01-15 17:59:45, P05, 5.02702153, 5., 20.52035697, 2.62176459, 0, 1, 5, 21.56977522, 75.97754859, 39.85714797, 110.74727473, True, True, True, 37.8226902168957, -122.324895, 0)",
"timestamp": "2020-01-15 17:59:45",
"type": "ReeferTelemetries"
}

Container Anomaly Event

Description: These events denote an anomaly being predicted for a container based on the telemetry reported by the IOT sensors in the containers. These events will trigger the Business Process Manager (BPM) process whereby a field engineer will get the container assigned in order to repair it. These events are part of the Container Anomaly, Reactive Messaging, and Dead Letter Queue (DLQ) patterns.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"containerID": "8919",
"payload": {
"ambiant_temperature": 19.8447,
"carbon_dioxide_level": 4.42579,
"content_type": 2,
"defrost_cycle": 6,
"humidity_level": 60.3148,
"kilowatts": 3.44686,

Container Anomaly Retry Event

Description: These events denote that the Business Process Manager (BPM) process was not called successfully and, as a result, another call attempt will be made. These events are part of the Container Anomaly and Dead Letter Queue (DLQ) patterns.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"containerID": "5982",
"payload": {
"ambiant_temperature": 19.8447,
"carbon_dioxide_level": 4.42579,
"content_type": 2,
"defrost_cycle": 6,
"humidity_level": 60.3148,
"kilowatts": 3.44686,

Container Anomaly Dead Event

Description: These events denote that the Business Process Manager (BPM) process was not called successfully either because the Containers component could not successfully authenticate against the Business Process Manager (BPM) or the call to the process did not succeed despite the retries. These events will keep the original container anomaly message’s data and a reason for this message to happen for further analysis by system administrators. These events are part of the Container Anomaly and Dead Letter Queue (DLQ) patterns.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events: None

Patterns these events are relevant to:

Example:

{
"containerID": "5982",
"payload": {
"ambiant_temperature": 19.8447,
"carbon_dioxide_level": 4.42579,
"content_type": 2,
"defrost_cycle": 6,
"humidity_level": 60.3148,
"kilowatts": 3.44686,

Container On Maintenance Event

Description: These events denote that a container has been set into maintenance mode as a result of a field engineer getting the container assigned to be repaired due to an anomaly being reported for such container. These events are a consequence of the Container Anomaly pattern.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"containerID": "8919",
"payload": {
"brand": "itgtests-brand",
"capacity": 100,
"containerID": "8919",
"latitude": 31.4,
"longitude": 121.5,
"status": "Empty",

Container Off Maintenance Event

Description: These events denote that a container has been set out of maintenance mode as a result of a field engineer having repaired the container as a result of a container anomaly reported. These events are a consequence of the Container Anomaly pattern.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"containerID": "8919",
"payload": {
"brand": "itgtests-brand",
"capacity": 100,
"containerID": "8919",
"latitude": 31.4,
"longitude": 121.5,
"status": "Empty",

Voyage Assigned Event

Description: These events denote that a voyage has been found and assigned to a shipping order, and viceversa, as part of the Saga pattern pattern for a long running transaction which is triggered as a result of a new shipping order being created. A voyage is a unique carriage of fresh goods by a ship from a source port to a destination port on a specific date.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"payload": {
"orderID": "85eb9236-ed11-4ba5-b4ec-055cb261ae6d",
"voyageID": "101"
},
"timestamp": 1588010536409,
"type": "VoyageAssigned",
"version": "1"
}

Voyage Not Found Event

Description: These events denote that a voyage for carrying the amount of fresh goods from the source port to the destination port on the specific date could not be found. As a result, the new shipping order will become rejected.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

Example:

{
"payload": {
"orderID": "564fa4ac-836a-4826-90f7-8ae50dd90790",
"reason": "Insufficient free capacity"
},
"timestamp": 1588010613958,
"type": "VoyageNotFound",
"version": "1"
}

Container Metric Event

Description: These events are produced by the Fleet Management microservice to simulate the container’s IOT sensor telemetries that are then consumed by the User Interface during simulation.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

  • None

Data Schema: TODO Define Container Metric Event schema

Example:

{
"payload": {
"shipID": "s01234",
"containerId": "c01234",
"tempC": "10",
"amp": "0",
"timestampMillis": 1588010613958
},
"timestamp": 1588010613958,

Ship Position Event

Description: These events are produced by the Fleet Management microservice to simulate the ship’s movement sensor telemetries that are then consumed by the User Interface during simulation.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

  • None

Data Schema: TODO Define Ship Position Event schema

Example:

{
"payload": {
"shipId": "s01234",
"latitude": "37.8044 N",
"longitdue": "122.2712 W",
"ts": 1588010613958
},
"timestamp": 1588010613958,
"type": "ShipPosition",

Bluewater Problem Event

Description: These events are produced by the Fleet Management microservice to alert issues during bluewater simulation runs and are consumed by the User Interface microservice.

Topic these events are produced to/consumed from:

Components that produce these events:

Components that react to these events:

Patterns these events are relevant to:

  • None

Data Schema: TODO Define Bluewater Problem Event schema

Example:

{
"payload": {
"shipId": "s01234",
"containerId": "c01234",
"status":"offline",
"issue": "co2sensor",
"latitude": "37.8044 N",
"longitdue": "122.2712 W",
"ts": 1588010613958