Skip to content

PURISTA API / Modules / @purista/amqpbridge

Module: @purista/amqpbridge

Package for using a AMQP broker like rabbitMQ as event bridge.

Example usage:

Example

typescript
import { AmqpBridge } from '@purista/amqpbridge'

// create and init our eventbridge
  const eventBridge = new AmqpBridge()
  await eventBridge.start()

Table of contents

Type Aliases

Variables

Functions

Event bridge

Type Aliases

AmqpBridgeConfig

Ƭ AmqpBridgeConfig: Object

AmqpBridge bridge config

See

amqplib documentation

Type declaration

NameTypeDescription
encoder?Encoderthe encoder(s) to be used for AMQP messages Default ts jsonEncoder
encrypter?Encrypterthe encrypter(s) to be used for AMQP messages Default ts plain
exchangeName?stringthe AMQP exchage name to be used Default ts purista
exchangeOptions?Options.AssertExchangethe AMQP exchange options
namePrefix?stringthe queue prefix to be used for all PURISTA queues except short living queues created by the broker on request Default ts purista
socketOptions?anysocket options
url?string | Options.Connectthe AMQP broker url Default ts amqp://localhost

Defined in

amqpbridge/src/types/AmqpBridgeConfig.ts:11


Encoder

Ƭ Encoder: Record<string, EncoderFunctions>

Defined in

amqpbridge/src/types/Encoder.ts:3


EncoderFunctions

Ƭ EncoderFunctions: Object

Type declaration

NameType
decode<T>(input: Buffer) => Promise<T>
encode<T>(input: T) => Promise<Buffer>

Defined in

amqpbridge/src/types/EncoderFunctions.ts:1


EncryptFunctions

Ƭ EncryptFunctions: Object

Type declaration

NameType
decrypt(input: Buffer) => Promise<Buffer>
encrypt(input: Buffer) => Promise<Buffer>

Defined in

amqpbridge/src/types/EncryptFunctions.ts:1


Encrypter

Ƭ Encrypter: Record<string, EncryptFunctions>

Defined in

amqpbridge/src/types/Encrypter.ts:3

Variables

puristaVersion

Const puristaVersion: "1.11.0"

Defined in

amqpbridge/src/version.ts:1

Functions

deserializeOtpFromAmqpHeader

deserializeOtpFromAmqpHeader(logger, message, encrypter, encoder): Promise<undefined | Context>

Parameters

NameType
loggerLogger
messagenull | ConsumeMessage
encrypterEncrypter
encoderEncoder

Returns

Promise<undefined | Context>

Defined in

amqpbridge/src/deserializeOtpFromAmqpHeader.impl.ts:9


getDefaultConfig

getDefaultConfig(): Complete<AmqpBridgeConfig> & { exchangeName: string ; url: string }

Returns

Complete<AmqpBridgeConfig> & { exchangeName: string ; url: string }

Defined in

amqpbridge/src/getDefaultConfig.impl.ts:5


serializeOtpForAmqpHeader

serializeOtpForAmqpHeader(header): Record<string, undefined | string>

Parameters

NameType
headerRecord<string, undefined | string>

Returns

Record<string, undefined | string>

Defined in

amqpbridge/src/serializeOtpForAmqpHeader.impl.ts:3