Repository navigation
Connectum v1.2.0
Highlights
- AMQP fail-fast startup —
@connectum/events-amqpfailFastOnInitialSetupError+ anonSetupFailedhook: a permanent topology/setup error on the first connect now rejectsconnect()with a typedAmqpTopologyErrorinstead of hanging silently under the default recovery (maxRetries: Infinity); a transient broker outage still waits and reconnects. (#205) - Trustworthy AMQP reconnect signals —
onReconnectingfires exactly once per scheduled retry (no double-counted metrics), and in-flight publish failures are classified by connection state rather than amqplib error text, keeping the connection-loss-vs-nack / at-least-once republish decision correct across amqplib upgrades. (#205)
Package changes
@connectum/events-amqp@1.2.0
Minor
-
#205
694fda0Thanks @intech! - Add opt-infailFastOnInitialSetupErrorand anonSetupFailedlifecycle callback.When recovery is enabled, a deterministic setup/topology error on the first connect can now reject
connect()with the typedAmqpTopologyErrorinstead of hanging forever in amqplib's infinite recovery loop (under the defaultmaxRetries: Infinity, amqplib never rejects the initial connect, so a permanent topology error previously hungconnect()/bus.start()silently). A transient broker-unreachable at startup still blocks-and-retries.onSetupFailed(error, { initial, attempt })surfaces setup/topology failures on the initial validation probe and on every reconnect — distinct from a mere broker outage. Default behavior is unchanged (both are opt-in). Also corrects thetopologyMode: "check"documentation, which previously promised unconditional "fail fast".
Patch
-
#205
694fda0Thanks @intech! - Harden the connection-loss-vs-nack classification of in-flight publishes. A per-confirm-channelcloseflag (set viaprependListener, before amqplib drains outstanding confirms) is now the primary structural signal for classifying a failed publish confirm asAmqpConnectionErrorvsAmqpPublishNackError; the amqplib error-text match is retained only as a defense-in-depth fallback. This makes the at-least-once republish decision robust to upstream error-text drift. No public API change, and genuine broker nacks on a live channel still classify asAmqpPublishNackError. -
#205
694fda0Thanks @intech! - FixonReconnectingfiring twice per failed reconnect cycle. amqplib emits bothconnect-failedandreconnect-scheduledfor a single failed attempt; the adapter now derivesonReconnectingsolely fromreconnect-scheduled, so it fires exactly once per scheduled retry. The terminal, retries-exhausted case remainsonReconnectFailed. Removes the undocumented{ attempt: -1 }sentinel that double-counted reconnect metrics. -
#208
3a846c4Thanks @intech! - docs(events-amqp): document republish-safety and recovery semantics- The Error Taxonomy now publishes an authoritative Message state / Republish (at-least-once) matrix (README + the errors
@moduleJSDoc) so at-least-once producers no longer infer retry-safety from class names. Connection loss is classified structurally and is never misreported as a nack;AmqpSerializationError/AmqpUnroutableError/AmqpTopologyErrorare documented as deterministic (do-not-republish). - Recovery docs clarify that
maxRetriesgoverns both the initial connect and every steady-state recovery series (counter reset on success), with the brittleness of a finite value, and that the effective reconnect delay can overshootmaxDelaybecause of equal-jitter. topologyMode: "check"and the recovery JSDoc are finalized: fail-fast applies only withrecovery: falseorfailFastOnInitialSetupError: true; under the default recovery a permanent setup error is surfaced viaonSetupFailed/onReconnecting.
- The Error Taxonomy now publishes an authoritative Message state / Republish (at-least-once) matrix (README + the errors