Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion en/api/@connectum/events-amqp/functions/AmqpAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> **AmqpAdapter**(`options`): `EventAdapter`

Defined in: [packages/events-amqp/src/AmqpAdapter.ts:336](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/AmqpAdapter.ts#L336)
Defined in: [packages/events-amqp/src/AmqpAdapter.ts:401](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/AmqpAdapter.ts#L401)

Create an AMQP/RabbitMQ adapter for @connectum/events.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ false

> `readonly` `optional` **lifecycle?**: [`AmqpLifecycleCallbacks`](AmqpLifecycleCallbacks.md)

Defined in: [packages/events-amqp/src/types.ts:158](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L158)
Defined in: [packages/events-amqp/src/types.ts:196](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L196)

Connection lifecycle callbacks. Connection errors are surfaced here —
not just logged.
Expand All @@ -124,7 +124,7 @@ Publisher options.

> `readonly` `optional` **publishTimeoutMs?**: `number`

Defined in: [packages/events-amqp/src/types.ts:168](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L168)
Defined in: [packages/events-amqp/src/types.ts:206](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L206)

Per-publish broker-outcome deadline in milliseconds. A publish whose
ack/nack/return/connection-loss outcome does not arrive in time
Expand Down Expand Up @@ -259,6 +259,53 @@ How topology is established:

***

### treatTopologyErrorAsFatal?

> `readonly` `optional` **treatTopologyErrorAsFatal?**: `boolean`

Defined in: [packages/events-amqp/src/types.ts:190](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L190)

Treat DETERMINISTIC topology drift during steady-state recovery as
fatal: stop the reconnect cycle instead of retrying forever against a
misconfigured broker.

Under the default `maxRetries: Infinity`, a queue/exchange deleted or
redeclared incompatibly while the adapter is reconnecting makes every
recovery attempt fail deterministically — the adapter would retry
forever, reporting `setup-failed` on each attempt but never giving up.
With this flag the adapter stops the cycle on the first such failure
and reports the terminal `reconnect-failed` lifecycle event (after the
`setup-failed` event for the same attempt); subsequent publishes fail
fast with `AmqpConnectionError`.

The gate is the AMQP reply code of the failure cause — `404`
(NOT_FOUND) or `406` (PRECONDITION_FAILED) — NOT the error class:
transient causes wrapped into `AmqpTopologyError` during a setup pass
(broker restarting `320`, internal error `541`, resource locked `405`,
a mid-setup connection drop) stay in normal recovery. One known
transient 404 is excluded explicitly: a RabbitMQ cluster classic queue
whose home node is down ("... down or inaccessible") stays in recovery.

After the fatal stop the adapter is fully torn down: consumers are dead
(subscription records are cleared, mirroring `disconnect()`), publishes
fail fast, and a later `connect()` starts from a clean slate —
re-subscribe explicitly.

Scope: steady-state recovery only. Boot-time drift is the startup
probe's job — see [failFastOnInitialSetupError](#failfastoninitialsetuperror). Setting both
covers boot and steady state; the remaining gap — broker unreachable at
`connect()` time with drift surfacing before the first successful
connect — is covered by neither flag until the bounded initial phase
lands ([https://github.com/Connectum-Framework/connectum/issues/198](https://github.com/Connectum-Framework/connectum/issues/198)).

#### Default

```ts
false
```

***

### url

> `readonly` **url**: `string`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

# Interface: AmqpBindingDeclaration

Defined in: [packages/events-amqp/src/types.ts:228](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L228)
Defined in: [packages/events-amqp/src/types.ts:266](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L266)

## Properties

### arguments?

> `readonly` `optional` **arguments?**: `Record`\<`string`, `unknown`\>

Defined in: [packages/events-amqp/src/types.ts:236](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L236)
Defined in: [packages/events-amqp/src/types.ts:274](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L274)

***

### exchange?

> `readonly` `optional` **exchange?**: `string`

Defined in: [packages/events-amqp/src/types.ts:232](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L232)
Defined in: [packages/events-amqp/src/types.ts:270](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L270)

Destination exchange name (exchange-to-exchange binding).

Expand All @@ -28,7 +28,7 @@ Destination exchange name (exchange-to-exchange binding).

> `readonly` `optional` **queue?**: `string`

Defined in: [packages/events-amqp/src/types.ts:230](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L230)
Defined in: [packages/events-amqp/src/types.ts:268](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L268)

Destination queue name (queue binding) — mutually exclusive with `exchange`.

Expand All @@ -38,14 +38,14 @@ Destination queue name (queue binding) — mutually exclusive with `exchange`.

> `readonly` **routingKey**: `string`

Defined in: [packages/events-amqp/src/types.ts:235](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L235)
Defined in: [packages/events-amqp/src/types.ts:273](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L273)

***

### source

> `readonly` **source**: `string`

Defined in: [packages/events-amqp/src/types.ts:234](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L234)
Defined in: [packages/events-amqp/src/types.ts:272](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L272)

Source exchange.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Interface: AmqpConsumerOptions

Defined in: [packages/events-amqp/src/types.ts:436](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L436)
Defined in: [packages/events-amqp/src/types.ts:478](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L478)

Consumer options.

Expand All @@ -12,7 +12,7 @@ Consumer options.

> `readonly` `optional` **exclusive?**: `boolean`

Defined in: [packages/events-amqp/src/types.ts:450](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L450)
Defined in: [packages/events-amqp/src/types.ts:492](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L492)

Whether the consumer is exclusive to this connection.

Expand All @@ -28,7 +28,7 @@ false

> `readonly` `optional` **prefetch?**: `number`

Defined in: [packages/events-amqp/src/types.ts:443](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L443)
Defined in: [packages/events-amqp/src/types.ts:485](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L485)

Prefetch count (QoS) — how many unacknowledged messages
a consumer can have at a time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

# Interface: AmqpExchangeDeclaration

Defined in: [packages/events-amqp/src/types.ts:210](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L210)
Defined in: [packages/events-amqp/src/types.ts:248](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L248)

## Properties

### arguments?

> `readonly` `optional` **arguments?**: `Record`\<`string`, `unknown`\>

Defined in: [packages/events-amqp/src/types.ts:216](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L216)
Defined in: [packages/events-amqp/src/types.ts:254](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L254)

Raw AMQP arguments passthrough.

Expand All @@ -20,28 +20,28 @@ Raw AMQP arguments passthrough.

> `readonly` `optional` **autoDelete?**: `boolean`

Defined in: [packages/events-amqp/src/types.ts:214](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L214)
Defined in: [packages/events-amqp/src/types.ts:252](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L252)

***

### durable?

> `readonly` `optional` **durable?**: `boolean`

Defined in: [packages/events-amqp/src/types.ts:213](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L213)
Defined in: [packages/events-amqp/src/types.ts:251](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L251)

***

### name

> `readonly` **name**: `string`

Defined in: [packages/events-amqp/src/types.ts:211](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L211)
Defined in: [packages/events-amqp/src/types.ts:249](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L249)

***

### type

> `readonly` **type**: `"headers"` \| `"topic"` \| `"direct"` \| `"fanout"`

Defined in: [packages/events-amqp/src/types.ts:212](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L212)
Defined in: [packages/events-amqp/src/types.ts:250](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L250)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Interface: AmqpExchangeOptions

Defined in: [packages/events-amqp/src/types.ts:385](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L385)
Defined in: [packages/events-amqp/src/types.ts:427](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L427)

Exchange assertion options.

Expand All @@ -12,7 +12,7 @@ Exchange assertion options.

> `readonly` `optional` **autoDelete?**: `boolean`

Defined in: [packages/events-amqp/src/types.ts:398](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L398)
Defined in: [packages/events-amqp/src/types.ts:440](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L440)

Whether the exchange is deleted when the last queue unbinds.

Expand All @@ -28,7 +28,7 @@ false

> `readonly` `optional` **durable?**: `boolean`

Defined in: [packages/events-amqp/src/types.ts:391](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L391)
Defined in: [packages/events-amqp/src/types.ts:433](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L433)

Whether the exchange should survive broker restarts.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Interface: AmqpLifecycleCallbacks

Defined in: [packages/events-amqp/src/types.ts:331](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L331)
Defined in: [packages/events-amqp/src/types.ts:371](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L371)

Connection lifecycle callbacks.

Expand All @@ -16,7 +16,7 @@ deprecated since 1.3.0 (removal not before 2.0).

> `readonly` `optional` **onConnected?**: () => `void`

Defined in: [packages/events-amqp/src/types.ts:351](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L351)
Defined in: [packages/events-amqp/src/types.ts:391](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L391)

#### Returns

Expand All @@ -32,7 +32,7 @@ Since 1.3.0 — use [onLifecycle](#onlifecycle) (`type: "connected"`). Kept unti

> `readonly` `optional` **onDisconnected?**: (`cause`) => `void`

Defined in: [packages/events-amqp/src/types.ts:353](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L353)
Defined in: [packages/events-amqp/src/types.ts:393](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L393)

#### Parameters

Expand All @@ -54,7 +54,7 @@ Since 1.3.0 — use [onLifecycle](#onlifecycle) (`type: "disconnected"`). Kept u

> `readonly` `optional` **onLifecycle?**: (`event`) => `void`

Defined in: [packages/events-amqp/src/types.ts:349](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L349)
Defined in: [packages/events-amqp/src/types.ts:389](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L389)

Single discriminated-union lifecycle callback — the preferred surface.
Receives every [AmqpLifecycleEvent](../type-aliases/AmqpLifecycleEvent.md), including `blocked`/`unblocked`,
Expand Down Expand Up @@ -88,7 +88,7 @@ deterministic misconfiguration at boot.

> `readonly` `optional` **onReconnectFailed?**: (`cause`) => `void`

Defined in: [packages/events-amqp/src/types.ts:364](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L364)
Defined in: [packages/events-amqp/src/types.ts:406](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L406)

#### Parameters

Expand All @@ -110,12 +110,14 @@ Since 1.3.0 — use [onLifecycle](#onlifecycle) (`type: "reconnect-failed"`). Ke

> `readonly` `optional` **onReconnecting?**: (`info`) => `void`

Defined in: [packages/events-amqp/src/types.ts:362](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L362)
Defined in: [packages/events-amqp/src/types.ts:404](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L404)

A reconnect attempt has been scheduled. Fires exactly ONCE per scheduled
retry (amqplib's `reconnect-scheduled`). A failed attempt that also emits
`connect-failed` does NOT double-invoke this; the terminal, retries-exhausted
case is reported via [onReconnectFailed](#onreconnectfailed), not here.
`connect-failed` does NOT double-invoke this; the terminal case (retry
budget exhausted, or a fatal topology stop under
`treatTopologyErrorAsFatal`) is reported via [onReconnectFailed](#onreconnectfailed),
not here.

#### Parameters

Expand Down Expand Up @@ -147,7 +149,7 @@ Since 1.3.0 — use [onLifecycle](#onlifecycle) (`type: "reconnecting"`). Kept u

> `readonly` `optional` **onSetupFailed?**: (`error`, `ctx`) => `void`

Defined in: [packages/events-amqp/src/types.ts:379](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L379)
Defined in: [packages/events-amqp/src/types.ts:421](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L421)

A setup/topology failure occurred while (re)applying the declarative
topology — on the initial connect's validation probe (`ctx.initial: true`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Interface: AmqpPublisherOptions

Defined in: [packages/events-amqp/src/types.ts:456](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L456)
Defined in: [packages/events-amqp/src/types.ts:498](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L498)

Publisher options.

Expand All @@ -12,7 +12,7 @@ Publisher options.

> `readonly` `optional` **correlationHeader?**: `boolean`

Defined in: [packages/events-amqp/src/types.ts:485](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L485)
Defined in: [packages/events-amqp/src/types.ts:527](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L527)

How `basic.return` frames are correlated to publishes when
`mandatory: true`. The return frame carries no deliveryTag, so:
Expand All @@ -36,7 +36,7 @@ true

> `readonly` `optional` **externalContract?**: `boolean`

Defined in: [packages/events-amqp/src/types.ts:514](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L514)
Defined in: [packages/events-amqp/src/types.ts:556](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L556)

Publish against an EXTERNAL (non-EventBus) message contract: suppress the
EventBus envelope so the wire frame carries ONLY contract-specified
Expand Down Expand Up @@ -74,7 +74,7 @@ false

> `readonly` `optional` **mandatory?**: `boolean`

Defined in: [packages/events-amqp/src/types.ts:470](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L470)
Defined in: [packages/events-amqp/src/types.ts:512](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L512)

Whether the message should be returned if it cannot be routed.
Unroutable messages reject the publish with `AmqpUnroutableError`.
Expand All @@ -91,7 +91,7 @@ false

> `readonly` `optional` **persistent?**: `boolean`

Defined in: [packages/events-amqp/src/types.ts:462](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L462)
Defined in: [packages/events-amqp/src/types.ts:504](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/types.ts#L504)

Whether messages should be persisted to disk (deliveryMode=2).

Expand Down
Loading
Loading