-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CORE-19256 A wrapper for all mediator state, to allow async outputs t…
…o be stored along with the messaging clients state (#1442) Store a list of bus bound output events per consumer input event along with the client supplied state object. MediatorState will be used by the mediator message pattern for all states. A hash of ConsumerRecords (e.g Key + FlowEvent) will be used as the key to store bus bound output records of the message processor. e.g SessionEvents/FlowStatus, Storing output events will allow them to be replayed when consumer input is replayed.
- Loading branch information
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
.../src/main/resources/avro/net/corda/data/messaging/mediator/MediatorReplayOutputEvent.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"type": "record", | ||
"name": "MediatorReplayOutputEvent", | ||
"namespace": "net.corda.data.messaging.mediator", | ||
"doc": "Record the details of output events to be replayed if necessary.", | ||
"fields": [ | ||
{ | ||
"name": "topic", | ||
"type": "string", | ||
"doc": "The topic the event should be sent to." | ||
}, | ||
{ | ||
"name": "key", | ||
"type": "bytes", | ||
"doc": "Avro serialized bytes of the event key." | ||
}, | ||
{ | ||
"name": "value", | ||
"type": ["null", "bytes"], | ||
"doc": "Avro serialized bytes of the event value." | ||
} | ||
] | ||
} |
21 changes: 21 additions & 0 deletions
21
...src/main/resources/avro/net/corda/data/messaging/mediator/MediatorReplayOutputEvents.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"type": "record", | ||
"name": "MediatorReplayOutputEvents", | ||
"namespace": "net.corda.data.messaging.mediator", | ||
"doc": "Record the output events for a given input event, to be replayed by the mediator if necessary.", | ||
"fields": [ | ||
{ | ||
"name": "inputEventHash", | ||
"type": "bytes", | ||
"doc": "Hash of the input event. Event key and value bytes are used to generated the hash. This hash will act as a unique key for consumer input events." | ||
}, | ||
{ | ||
"name": "outputEvents", | ||
"type": { | ||
"type": "array", | ||
"items": "net.corda.data.messaging.mediator.MediatorReplayOutputEvent" | ||
}, | ||
"doc": "The list of output events for the given input events." | ||
} | ||
] | ||
} |
21 changes: 21 additions & 0 deletions
21
.../avro-schema/src/main/resources/avro/net/corda/data/messaging/mediator/MediatorState.avsc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"type": "record", | ||
"name": "MediatorState", | ||
"namespace": "net.corda.data.messaging.mediator", | ||
"doc": "Mediator state wrapper to store replayed events", | ||
"fields": [ | ||
{ | ||
"name": "state", | ||
"type": ["null", "bytes"], | ||
"doc": "The messaging library clients state." | ||
}, | ||
{ | ||
"name": "outputEvents", | ||
"type": { | ||
"type": "array", | ||
"items": "net.corda.data.messaging.mediator.MediatorReplayOutputEvents" | ||
}, | ||
"doc": "Records output events to be sent to the message bus for each input event processed for this state." | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters