@@ -36,6 +36,29 @@ export interface RecipientModuleConfigOptions {
36
36
*/
37
37
maximumMessagePickup ?: number
38
38
39
+ /**
40
+ * Initial interval in milliseconds between reconnection attempts when losing connection with the mediator. This value is doubled after
41
+ * each retry, resulting in an exponential backoff strategy.
42
+ *
43
+ * For instance, if maximumMediatorReconnectionIntervalMs is b, the agent will attempt to reconnect after b, 2*b, 4*b, 8*b, 16*b, ... ms.
44
+ *
45
+ * This is only applicable when pickup protocol v2 or implicit pickup is used.
46
+ *
47
+ * @default 100
48
+ */
49
+ baseMediatorReconnectionIntervalMs ?: number
50
+
51
+ /**
52
+ * Maximum interval in milliseconds between reconnection attempts when losing connection with the mediator.
53
+ *
54
+ * For instance, if maximumMediatorReconnectionIntervalMs is set to 1000 and maximumMediatorReconnectionIntervalMs is set to 10000,
55
+ * the agent will attempt to reconnect after 1000, 2000, 4000, 8000, 10000, ..., 10000 ms.
56
+ *
57
+ * This is only applicable when pickup protocol v2 or implicit pickup is used.
58
+ * @default Number.POSITIVE_INFINITY
59
+ */
60
+ maximumMediatorReconnectionIntervalMs ?: number
61
+
39
62
/**
40
63
* Invitation url for connection to a mediator. If provided, a connection to the mediator will be made, and the mediator will be set as default.
41
64
* This is meant as the simplest form of connecting to a mediator, if more control is desired the api should be used.
@@ -67,6 +90,16 @@ export class RecipientModuleConfig {
67
90
return this . options . maximumMessagePickup ?? 10
68
91
}
69
92
93
+ /** See {@link RecipientModuleConfigOptions.baseMediatorReconnectionIntervalMs} */
94
+ public get baseMediatorReconnectionIntervalMs ( ) {
95
+ return this . options . baseMediatorReconnectionIntervalMs ?? 100
96
+ }
97
+
98
+ /** See {@link RecipientModuleConfigOptions.maximumMediatorReconnectionIntervalMs} */
99
+ public get maximumMediatorReconnectionIntervalMs ( ) {
100
+ return this . options . maximumMediatorReconnectionIntervalMs ?? Number . POSITIVE_INFINITY
101
+ }
102
+
70
103
/** See {@link RecipientModuleConfigOptions.mediatorInvitationUrl} */
71
104
public get mediatorInvitationUrl ( ) {
72
105
return this . options . mediatorInvitationUrl
0 commit comments