Options
All
  • Public
  • Public/Protected
  • All
Menu

Define the Engine's configuration and its defaults.

Index

Type aliases

AMQPEvent

AMQPEvent: { message: any; props?: Publish }

AMQP event to send

Type declaration

  • message: any

    Message to send

  • Optional props?: Publish

    Options for the message (like expiration date, ...)

ConsumerHandler

ConsumerHandler: (publishers: PublisherHandlers, message: any) => Promise<void>

Type declaration

    • Consumer function called for each received message. If the function succeeds, the the message will be acknowleged with Channel.ack, otherwise it will be rejected with Channel.nack.

      Parameters

      • publishers: PublisherHandlers

        Set of generated publisher.

      • message: any

        Received message.

      Returns Promise<void>

DefaultConfig

DefaultConfig: { Engine: EngineOptions; Exchange: ExchangeOptions; Queue: QueueOptions; QueueBinding: QueueBinding }

Type declaration

EngineOptions

EngineOptions: { consumers: {}; exchanges: {}; publishers: {}; queues: {}; url: string }

Engine configuration

Type declaration

  • consumers: {}

    Set of consumers to setup

  • exchanges: {}

    Set of exchanges to configure

  • publishers: {}

    Set of publishers to configure

  • queues: {}

    Set of queues to configure

  • url: string

    AMQP broker URL

ExchangeOptions

ExchangeOptions: { options: AssertExchange; type: "topic" | "fanout" | "direct" }

Exchange configuration

Type declaration

  • options: AssertExchange

    AMQP exchange options

  • type: "topic" | "fanout" | "direct"

    AMQP exchange type

ExchangePublisherOptions

ExchangePublisherOptions: { exchange: string; routingKey: string }

Exchange Publisher configuration

Type declaration

  • exchange: string

    AMQP exchange's name (should be declared by an ExchangeOptions structure)

  • routingKey: string

    Routing Key to use for later routing

PublisherHandlers

PublisherHandlers: {}

Set of generated publisher functions

Type declaration

  • [publisherName: string]: (event: AMQPEvent) => void
      • Parameters

        • event: AMQPEvent

          AMQP event to publish to the queue or exchange.

        Returns void

PublisherOptions

Publisher configuration. A publisher can publish message to an exchange or directly to a queue.

QueueBinding

QueueBinding: { exchange: string; routingKey: string }

Route from an exchange to a queue

Type declaration

  • exchange: string

    AMQP exchange's name (should be declared by an ExchangeOptions structure)

  • routingKey: string

    Routing Key to use to route messages from the exchange

QueueOptions

QueueOptions: { bindings: QueueBinding[]; options: AssertQueue }

Queue configuration

Type declaration

QueuePublisherOptions

QueuePublisherOptions: { queue: string }

Queue Publisher configuration

Type declaration

  • queue: string

    AMQP queue name (should be declared by a QueueOptions structure)

Variables

Const DefaultOptions

DefaultOptions: DefaultConfig = ...

Default configuration options

Generated using TypeDoc