Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MessageSource

Service type for data producer. Providers are publishing data to a specific event bus address.

Hierarchy

  • MessageSource

Index

Properties

Methods

Properties

Static Readonly TYPE

TYPE: string

Static Readonly UNKNOWN

UNKNOWN: string

Unknown type.

Methods

Static createRecord

  • createRecord(name: string, address: string, type: string, metadata: {}): Record
  • createRecord(name: string, address: string, type: string): Record
  • createRecord(name: string, address: string): Record
  • Create a record representing a data producer.

    Parameters

    • name: string
    • address: string
    • type: string
    • metadata: {}
      • [key: string]: any

    Returns Record

  • Same as {@link MessageSource#createRecord} without additional metadata.

    Parameters

    • name: string
    • address: string
    • type: string

    Returns Record

  • Same as {@link MessageSource#createRecord} without additional metadata, and no type for the payload.

    Parameters

    • name: string
    • address: string

    Returns Record

Static getConsumer

  • getConsumer<T>(discovery: ServiceDiscovery, filter: {}): PromiseLike<MessageConsumer<T>>
  • getConsumer<T>(discovery: ServiceDiscovery, filter: {}, resultHandler: ((res: AsyncResult<MessageConsumer<T>>) => void) | Handler<AsyncResult<MessageConsumer<T>>>): void
  • getConsumer<T>(discovery: ServiceDiscovery, filter: (arg: Record) => boolean): PromiseLike<MessageConsumer<T>>
  • getConsumer<T>(discovery: ServiceDiscovery, filter: (arg: Record) => boolean, resultHandler: ((res: AsyncResult<MessageConsumer<T>>) => void) | Handler<AsyncResult<MessageConsumer<T>>>): void
  • Convenient method that looks for a message source and provides the configured . The async result is marked as failed is there are no matching services, or if the lookup fails.

    Type parameters

    • T

    Parameters

    Returns PromiseLike<MessageConsumer<T>>

  • Convenient method that looks for a message source and provides the configured . The async result is marked as failed is there are no matching services, or if the lookup fails.

    Type parameters

    • T

    Parameters

    • discovery: ServiceDiscovery
    • filter: {}
      • [key: string]: any
    • resultHandler: ((res: AsyncResult<MessageConsumer<T>>) => void) | Handler<AsyncResult<MessageConsumer<T>>>

    Returns void

  • Convenient method that looks for a message source and provides the configured . The async result is marked as failed is there are no matching services, or if the lookup fails.

    Type parameters

    • T

    Parameters

    Returns PromiseLike<MessageConsumer<T>>

  • Convenient method that looks for a message source and provides the configured . The async result is marked as failed is there are no matching services, or if the lookup fails.

    Type parameters

    • T

    Parameters

    • discovery: ServiceDiscovery
    • filter: (arg: Record) => boolean
        • Parameters

          Returns boolean

    • resultHandler: ((res: AsyncResult<MessageConsumer<T>>) => void) | Handler<AsyncResult<MessageConsumer<T>>>

    Returns void

Generated using TypeDoc