Connectum API Reference / @connectum/events-amqp / types / AmqpPublisherOptions
Interface: AmqpPublisherOptions ​
Defined in: packages/events-amqp/src/types.ts:887
Publisher options.
Properties ​
correlationHeader? ​
readonlyoptionalcorrelationHeader?:boolean
Defined in: packages/events-amqp/src/types.ts:916
How basic.return frames are correlated to publishes when mandatory: true. The return frame carries no deliveryTag, so:
true(default): stamp a privatex-connectum-publish-idheader on mandatory publishes and match returns by it. The header is visible on the wire to external consumers — document it in contracts.false: no header; mandatory publishes are serialized (single-flight) so at most one is outstanding at a time — correlation is unambiguous at the cost of throughput.
Default ​
trueexternalContract? ​
readonlyoptionalexternalContract?:boolean
Defined in: packages/events-amqp/src/types.ts:945
Publish against an EXTERNAL (non-EventBus) message contract: suppress the EventBus envelope so the wire frame carries ONLY contract-specified properties. For an external AsyncAPI/AMQP contract the oracle is the published spec, not this serializer — a third-party consumer validates the exact header/property set, which must not include adapter-internal fields.
When true, publish():
- does NOT stamp the
x-event-id/x-published-atheaders; - does NOT auto-populate the
messageIdortimestampproperties; - uses single-flight correlation for
mandatorypublishes (so nox-connectum-publish-idheader reaches the wire) —correlationHeaderis ignored in this mode.
The frame then carries only contentType, persistent/deliveryMode, mandatory, and exactly the headers passed via PublishOptions.metadata. Per-message confirms, mandatory → AmqpUnroutableError, the typed error taxonomy, and connection recovery are unchanged.
Leave unset (default) for normal EventBus use, where the envelope is stamped on publish and stripped on delivery. When the contract requires a specific messageId / timestamp, set them per-publish via PublishOptions.messageId / PublishOptions.timestamp (a caller-supplied value is used as-is; in external-contract mode nothing is auto-generated).
Default ​
falsemandatory? ​
readonlyoptionalmandatory?:boolean
Defined in: packages/events-amqp/src/types.ts:901
Whether the message should be returned if it cannot be routed. Unroutable messages reject the publish with AmqpUnroutableError.
Default ​
falsepersistent? ​
readonlyoptionalpersistent?:boolean
Defined in: packages/events-amqp/src/types.ts:893
Whether messages should be persisted to disk (deliveryMode=2).
Default ​
true