Interface ExchangeChain<TMessage, TReply>

Type Parameters

  • TMessage

  • TReply

Hierarchy

Properties

publish: PublishToExchange<TMessage>
rpc: RpcToExchange<TMessage, TReply>

Methods

  • Bind an exchange to the main exchange. See Exchange to Exchange bindings

    For patterns there are two wildcards:

    • * - one word
    • # - zero or more words A word is dot(period) delimited

    Type Parameters

    • TCustomMessage = unknown

    • TCustomReply = unknown

    Parameters

    • exchange: Exchange<TCustomMessage>

      Exchange to bind

    • pattern: string | string[]

      Pattern(s) to use

    Returns ExchangeChain<MergeTypes<TMessage, TCustomMessage>, MergeTypes<TReply, TCustomReply>>

  • Assert and bind an exchange to the main exchange. See Exchange to Exchange bindings

    For patterns there are two wildcards:

    • * - one word
    • # - zero or more words A word is dot(period) delimited

    Parameters

    • exchangeName: string

      name of the exchange to forward messages from

    • pattern: string | string[]

      pattern(s) to bind

    • exchangeType: ExchangeType

      type of the exchange

    • Optional exchangeOpts: ExchangeOptions

      extra options for asserting the exchange

    Returns ExchangeChain<TMessage, TReply>

  • Bind an exchange to the main exchange.

    For patterns there are two wildcards:

    • * - one word
    • # - zero or more words A word is dot(period) delimited

    Type Parameters

    • TCustomMessage = unknown

    • TCustomReply = unknown

    Parameters

    • exchange: string

      Name of the exchange to bind

    • pattern: string | string[]

      Pattern(s) to use

    • type: ExchangeType

      Type of the exchange

    • Optional opts: Partial<ExchangeOptions>

      Options to pass to amqplib for asserting

    Returns ExchangeChain<MergeTypes<TMessage, TCustomMessage>, MergeTypes<TReply, TCustomReply>>

  • Return the state of the chain for inspection

    Returns Partial<HaredoChainState<TMessage, TReply>>

  • Enable json mode (it's enabled by default). When json is enabled, messages that are published without using prepared message objects will be passed through JSON.stringify. When subscribing message data will be run through JSON.parse

    Parameters

    • Optional json: boolean

      defaults to true

    Returns ExchangeChain<TMessage, TReply>

  • Assert / Bind exchanges/queues. Will be skipped if skipSetup is set in the chain

    Returns Promise<void>

  • Don't run automatic setup. Useful for faster publishing.

    Parameters

    • Optional skipSetup: boolean

      defaults to true

    Returns ExchangeChain<TMessage, TReply>

Generated using TypeDoc