You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-23Lines changed: 44 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,34 +244,36 @@ Both publishers and consumers accept a queue name and configuration as parameter
244
244
245
245
If you do not want to create a new queue/topic, you can set `queueLocator` field for `queueConfiguration`. In that case `message-queue-toolkit` will not attempt to create a new queue or topic, and instead throw an error if they don't already exist.
When using `locatorConfig` to reference existing queues or topics, the default behavior is to fail immediately if the resource doesn't exist. However, in some deployment scenarios (especially with cross-service dependencies), resources may not be available at startup time.
250
250
251
-
The `resourceAvailabilityConfig` option enables "eventual consistency mode" where consumers poll for resources to become available instead of failing immediately.
251
+
The `startupResourcePolling` option within `locatorConfig` enables "eventual consistency mode" where consumers poll for resources to become available instead of failing immediately.
252
252
253
253
### Use Case: Cross-Service Dependencies
254
254
255
255
Consider two services that need to subscribe to each other's topics:
256
256
-**Service A** needs to subscribe to **Service B's** topic
257
257
-**Service B** needs to subscribe to **Service A's** topic
258
258
259
-
Without eventual consistency mode, neither service can deploy first because the other's topic doesn't exist yet. With `resourceAvailabilityConfig`, both services can start simultaneously and wait for the other's resources to appear.
259
+
Without eventual consistency mode, neither service can deploy first because the other's topic doesn't exist yet. With `startupResourcePolling`, both services can start simultaneously and wait for the other's resources to appear.
|`enabled`|`boolean`|-|Must be set to `true` to enable polling|
284
286
|`pollingIntervalMs`|`number`|`5000`| Interval between availability checks (ms) |
285
-
|`timeoutMs`|`number`|`undefined`| Maximum wait time before throwing `ResourceAvailabilityTimeoutError`. If not set, polls indefinitely |
287
+
|`timeoutMs`|`number \| NO_TIMEOUT`|- (required) |Maximum wait time before throwing `StartupResourcePollingTimeoutError`. Use `NO_TIMEOUT` to poll indefinitely |
0 commit comments