Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AMQPEventClient

AMQP / RabbitMQ Client

export
implements

{IEventClient}

Hierarchy

  • AMQPEventClient

Implements

Index

Constructors

constructor

  • new AMQPEventClient(url: string | Connect, socketOptions?: any): AMQPEventClient
  • Creates an instance of AMQPEventClient.

    memberof

    AMQPEventClient

    Parameters

    • url: string | Connect

      AMQP Connection URL

    • Optional socketOptions: any

      Socket Options, i.e. noDelay

    Returns AMQPEventClient

Methods

dispose

  • dispose(): Promise<void>
  • Cleanup AMQP Client

    memberof

    AMQPEventClient

    Returns Promise<void>

onError

  • onError(errorHandler: (err: Error) => void): Promise<void>
  • Add Error Handler

    memberof

    AMQPEventClient

    Parameters

    • errorHandler: (err: Error) => void
        • Parameters

          Returns void

    Returns Promise<void>

publish

  • publish<T>(queue: string, message: T): Promise<void>
  • Publish a Message to Queue

    template

    T

    memberof

    AMQPEventClient

    Type parameters

    • T

    Parameters

    • queue: string

      Queue Name

    • message: T

      Message to publish

    Returns Promise<void>

subscribe

  • subscribe<T>(queue: string, callback: (message: T) => void): Promise<void>
  • Subscribe to Queue

    template

    T

    memberof

    AMQPEventClient

    Type parameters

    • T

    Parameters

    • queue: string

      Queue Name

    • callback: (message: T) => void

      Incoming Message Callback

        • (message: T): void
        • Parameters

          • message: T

          Returns void

    Returns Promise<void>

waitForReady

  • waitForReady(): Promise<boolean>
  • Wait for ready state

    memberof

    AMQPEventClient

    Returns Promise<boolean>

Generated using TypeDoc