PURISTA API / Modules / @purista/amqpbridge
Module: @purista/amqpbridge
Package for using a AMQP broker like rabbitMQ as event bridge.
Example usage:
Example
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
Type declaration
Name | Type | Description |
---|---|---|
encoder? | Encoder | the encoder(s) to be used for AMQP messages Default ts jsonEncoder |
encrypter? | Encrypter | the encrypter(s) to be used for AMQP messages Default ts plain |
exchangeName? | string | the AMQP exchage name to be used Default ts purista |
exchangeOptions? | Options.AssertExchange | the AMQP exchange options |
namePrefix? | string | the queue prefix to be used for all PURISTA queues except short living queues created by the broker on request Default ts purista |
socketOptions? | any | socket options |
url? | string | Options.Connect | the 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
Name | Type |
---|---|
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
Name | Type |
---|---|
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
Functions
deserializeOtpFromAmqpHeader
▸ deserializeOtpFromAmqpHeader(logger
, message
, encrypter
, encoder
): Promise
<undefined
| Context
>
Parameters
Name | Type |
---|---|
logger | Logger |
message | null | ConsumeMessage |
encrypter | Encrypter |
encoder | Encoder |
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
Name | Type |
---|---|
header | Record <string , undefined | string > |
Returns
Record
<string
, undefined
| string
>