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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Class: AmqpSerializationError

Defined in: [packages/events-amqp/src/errors.ts:75](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/errors.ts#L75)
Defined in: [packages/events-amqp/src/errors.ts:112](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/errors.ts#L112)

Payload encoding/decoding failed in a custom serialization hook.

Expand Down
24 changes: 21 additions & 3 deletions en/api/@connectum/events-amqp/classes/AmqpTopologyError.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

# Class: AmqpTopologyError

Defined in: [packages/events-amqp/src/errors.ts:72](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/errors.ts#L72)
Defined in: [packages/events-amqp/src/errors.ts:93](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/errors.ts#L93)

Topology declaration or verification failed: missing exchange/queue in
`check`/`skip` mode, or a conflicting redeclare (PRECONDITION_FAILED) in
`assert` mode.

`object` identifies the failing topology object structurally (known at the
declare/check site — no broker-reply text parsing needed for CI drift
checks or observability). `object.kind` says WHAT was being declared;
failure classification (WHY it failed) stays with the error class and
`cause`.

## Extends

- [`AmqpAdapterError`](AmqpAdapterError.md)
Expand All @@ -18,7 +24,7 @@ Topology declaration or verification failed: missing exchange/queue in

> **new AmqpTopologyError**(`message`, `options?`): `AmqpTopologyError`

Defined in: [packages/events-amqp/src/errors.ts:31](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/errors.ts#L31)
Defined in: [packages/events-amqp/src/errors.ts:99](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/errors.ts#L99)

#### Parameters

Expand All @@ -32,11 +38,15 @@ Defined in: [packages/events-amqp/src/errors.ts:31](https://github.com/Connectum

`unknown`

###### object?

[`AmqpTopologyObject`](../type-aliases/AmqpTopologyObject.md)

#### Returns

`AmqpTopologyError`

#### Inherited from
#### Overrides

[`AmqpAdapterError`](AmqpAdapterError.md).[`constructor`](AmqpAdapterError.md#constructor)

Expand Down Expand Up @@ -78,6 +88,14 @@ Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/li

***

### object?

> `readonly` `optional` **object?**: [`AmqpTopologyObject`](../type-aliases/AmqpTopologyObject.md)

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

***

### stack?

> `optional` **stack?**: `string`
Expand Down
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:335](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/AmqpAdapter.ts#L335)
Defined in: [packages/events-amqp/src/AmqpAdapter.ts:336](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/AmqpAdapter.ts#L336)

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

Expand Down
2 changes: 1 addition & 1 deletion en/api/@connectum/events-amqp/functions/toAmqpPattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

> **toAmqpPattern**(`pattern`): `string`

Defined in: [packages/events-amqp/src/AmqpAdapter.ts:53](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/AmqpAdapter.ts#L53)
Defined in: [packages/events-amqp/src/AmqpAdapter.ts:54](https://github.com/Connectum-Framework/connectum/blob/main/packages/events-amqp/src/AmqpAdapter.ts#L54)

Convert an EventBus wildcard pattern to an AMQP routing key pattern.

Expand Down
4 changes: 4 additions & 0 deletions en/api/@connectum/events-amqp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
- [AmqpTopologyError](classes/AmqpTopologyError.md)
- [AmqpUnroutableError](classes/AmqpUnroutableError.md)

## Type Aliases

- [AmqpTopologyObject](type-aliases/AmqpTopologyObject.md)

## Functions

- [AmqpAdapter](functions/AmqpAdapter.md)
Expand Down
11 changes: 11 additions & 0 deletions en/api/@connectum/events-amqp/type-aliases/AmqpTopologyObject.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Connectum API Reference](../../../index.md) / [@connectum/events-amqp](../index.md) / AmqpTopologyObject

# Type Alias: AmqpTopologyObject

> **AmqpTopologyObject** = \{ `kind`: `"exchange"` \| `"queue"`; `name`: `string`; \} \| \{ `destination`: `string`; `destinationType`: `"queue"` \| `"exchange"`; `kind`: `"binding"`; `routingKey`: `string`; `source`: `string`; \}

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

Machine-readable identity of the topology object a declaration or
verification failed on. A binding has no name of its own — it is identified
by its endpoints and routing key — hence the discriminated shape.
2 changes: 1 addition & 1 deletion en/api/typedoc-sidebar.json

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions en/packages/events-amqp.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,21 @@ Every terminal publish/topology outcome is distinguishable by error class -- wha
| `AmqpUnroutableError` | Broker returned a `mandatory` message as unroutable (`basic.return`); has `.routingKey` |
| `AmqpPublishNackError` | Broker negatively acknowledged (nacked) a published message |
| `AmqpPublishTimeoutError` | No broker outcome within `publishTimeoutMs`; message state UNKNOWN |
| `AmqpTopologyError` | Topology declaration or verification failed (missing object in `check` mode, conflicting redeclare in `assert` mode) |
| `AmqpTopologyError` | Topology declaration or verification failed (missing object in `check` mode, conflicting redeclare in `assert` mode); carries a machine-readable `.object` since 1.3.0 |
| `AmqpSerializationError` | Payload encoding failed in a custom `serialization.encode` hook |

Since 1.3.0, `AmqpTopologyError` also carries **`object`** (`AmqpTopologyObject`) identifying the failing topology object -- `{ kind: 'exchange' | 'queue', name }` or `{ kind: 'binding', source, destination, destinationType, routingKey }` (a binding has no name of its own). It is populated structurally at the declare/check/consume site, so CI drift checks and observability never parse broker-reply text. One documented exception: the config-validation error for a malformed binding declaration (neither `queue` nor `exchange` set) carries no `object`.

```typescript
try {
await bus.start();
} catch (err) {
if (err instanceof AmqpTopologyError && err.object?.kind === 'queue') {
console.error(`Topology drift: queue '${err.object.name}' rejected by the broker`, err.cause);
}
}
```

## Connection Recovery

Recovery is delegated to amqplib v2 native opt-in recovery and is **enabled by default**. Pass `recovery: false` to restore single-shot, no-reconnect behavior, or pass an `AmqpRecoveryOptions` object to tune the backoff.
Expand Down Expand Up @@ -578,7 +590,8 @@ Internal headers (`x-event-id`, `x-published-at`, `x-connectum-publish-id`) are
| `AmqpUnroutableError` | Mandatory message returned as unroutable (has `.routingKey`) |
| `AmqpPublishNackError` | Broker nacked a published message |
| `AmqpPublishTimeoutError` | No broker outcome within `publishTimeoutMs` |
| `AmqpTopologyError` | Topology declaration or verification failed |
| `AmqpTopologyError` | Topology declaration or verification failed; carries `.object` (since 1.3.0) |
| `AmqpTopologyObject` | Machine-readable identity of the failing topology object (exchange/queue by name; binding by endpoints) — since 1.3.0 |
| `AmqpSerializationError` | Payload encoding/decoding failed in a custom hook |
| `AmqpAdapterOptions` | Configuration options type |
| `AmqpExchangeOptions` | Exchange declaration options type |
Expand All @@ -590,6 +603,7 @@ Internal headers (`x-event-id`, `x-published-at`, `x-connectum-publish-id`) are
| `AmqpQueueOverride` | External queue override type |
| `AmqpRecoveryOptions` | Recovery backoff options type |
| `AmqpLifecycleCallbacks` | Connection lifecycle callbacks type |
| `AmqpLifecycleEvent` | Discriminated lifecycle event union delivered to `onLifecycle` — since 1.3.0 |

## Related Packages

Expand Down
Loading