Skip to content

Commit

Permalink
CORE-16174 move session context props from SessionInit to SessionEven…
Browse files Browse the repository at this point in the history
…t so it can be set both directions (#1212)

Remove config fields not used anymore.
counterparty lookups are no longer retriable.
Session events are not resent.
  • Loading branch information
LWogan authored Aug 30, 2023
1 parent bba5dd3 commit 31810fb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
"net.corda.data.flow.event.session.SessionClose",
"net.corda.data.flow.event.session.SessionError"
]
},
{
"name": "contextSessionProperties",
"type": ["null", "net.corda.data.KeyValuePairList"],
"doc": "A map of context properties received from a counterparty related to this flow session. This is static data and will be set to null when previously sent."
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,5 @@
"name": "SessionConfirm",
"doc" : "Acknowledge to counterparty that the session has been confirmed and is ready to send and receive messages.",
"namespace": "net.corda.data.flow.event.session",
"fields": [
{
"name": "contextSessionProperties",
"type": "net.corda.data.KeyValuePairList",
"doc": "A map of context properties received from a counterparty related to this flow session. This contains information such as protocol name and version that this flow is running."
}
]
"fields": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{
"name": "sessionInit",
"type": ["null", "net.corda.data.flow.event.session.SessionInit"],
"doc": "Contains information that can be used to start an initiated flow, piggybacked on initial data messages. Will be null for messages sent to the initiator. Will be null when initiated party is confirmed to be present via receipt of any data message previously."
"doc": "Contains information that can be used to start an initiated flow, piggybacked on initial data messages. Will be null for messages sent to the initiator. Will be null when initiated party is confirmed to be present to ensure out of order messages that arrive first contain this info."
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
"name": "contextPlatformProperties",
"type": "net.corda.data.KeyValuePairList",
"doc": "A map of context platform properties made available to the flow which will also be propagated to sub flows, initiated flows and services"
},
{
"name": "contextSessionProperties",
"type": "net.corda.data.KeyValuePairList",
"doc": "A map of context properties to send to a counterparty related to this flow session. This contains information such as protocol name and versions supported."
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
"doc": "Whether the session state has already scheduled a cleanup event with the flow mapper."
},
{
"name": "counterpartySessionProperties",
"name": "sessionProperties",
"type": [
"null",
"net.corda.data.KeyValuePairList"
],
"doc": "A map of context properties received from a counterparty related to this flow session. This contains information such as protocol name and the version running."
"doc": "A map of context properties related to this flow session. This contains information such as protocol name and the version running."
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ private FlowConfig() {

public static final String EXTERNAL_EVENT_MESSAGE_RESEND_WINDOW = "event.messageResendWindow";
public static final String EXTERNAL_EVENT_MAX_RETRIES = "event.maxRetries";
public static final String SESSION_MESSAGE_RESEND_WINDOW = "session.messageResendWindow";
public static final String SESSION_HEARTBEAT_TIMEOUT_WINDOW = "session.heartbeatTimeout";
public static final String SESSION_MISSING_COUNTERPARTY_TIMEOUT_WINDOW = "session.missingCounterpartyTimeout";
public static final String SESSION_TIMEOUT_WINDOW = "session.timeout";
public static final String SESSION_P2P_TTL = "session.p2pTTL";
public static final String SESSION_FLOW_CLEANUP_TIME = "session.cleanupTime";
public static final String PROCESSING_MAX_RETRY_ATTEMPTS = "processing.maxRetryAttempts";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,12 @@
"type": "object",
"default": {},
"properties": {
"messageResendWindow": {
"description": "The length of time in milliseconds that Corda waits before resending unacknowledged flow session messages.",
"type": "integer",
"minimum": 1000,
"maximum": 2147483647,
"default": 120000
},
"heartbeatTimeout": {
"description": "The length of time in milliseconds that Corda waits when no message has been received from a counterparty before causing the session to error. This should be set at least 2 times larger than session.messageResendWindow.",
"timeout": {
"description": "The length of time in milliseconds that Corda waits when no message has been received from a counterparty before causing the session to error.",
"type": "integer",
"minimum": 1000,
"maximum": 2147483647,
"default": 1800000
},
"missingCounterpartyTimeout": {
"description": "The length of time in milliseconds to wait when the counterparty can't be found in a member lookup before causing the session to error",
"type": "integer",
"minimum": 1000,
"maximum": 2147483647,
"default": 300000
},
"p2pTTL": {
"description": "The TTL set in milliseconds. This is added to the current time and set on messages passed to the P2P layer to send to a counterparty. Messages received with a TTL timestamp set in the past will be discarded.",
Expand Down

0 comments on commit 31810fb

Please sign in to comment.