Constructors
constructor
- new default(__namedParameters, broker, logger): default
-
Properties
Private
Readonly
aggregateType
aggregateType: string
Private
Readonly
broker
broker: BrokerAsPromised
Private
Readonly
messageType
messageType: string
Methods
Private
attachEventHandlers
- attachEventHandlers(session): void
-
Parameters
-
session: PublicationSession
Returns void
Private
createEnvelope
- createEnvelope(messageId, aggregateId, payload, overrides): MessageEnvelope<unknown>
-
Parameters
-
messageId: string
-
aggregateId: string
-
payload: unknown
-
Private
getSigningData
- getSigningData(envelope, eventSigning): {
body: string | MessageEnvelope<unknown>;
headers?: {
x-mosaic-signature: string;
x-mosaic-signature-key-version: number;
};
}
-
Parameters
-
-
eventSigning: undefined | Required<Pick<ValueObject<{
rmqChannelMax: (() => number);
rmqDevMiddleware: (() => boolean);
rmqEventSigningKeyVersion: (() => number);
rmqEventSigningKeyVersionsToRevoke: (() => number[]);
rmqEventSigningPrivateKey: (() => string);
rmqEventSigningPublicKey: (() => string);
rmqHost: (() => string);
rmqMgmtHost: (() => undefined | string);
rmqMgmtPort: (() => undefined | number);
rmqMgmtProtocol: (() => undefined | string);
rmqPassword: (() => string);
rmqPort: (() => number);
rmqProtocol: (() => string);
rmqUser: (() => string);
rmqVHost: (() => string);
rmqVHostAssert: (() => boolean);
}>, "rmqEventSigningPrivateKey" | "rmqEventSigningKeyVersion">>
Returns {
body: string | MessageEnvelope<unknown>;
headers?: {
x-mosaic-signature: string;
x-mosaic-signature-key-version: number;
};
}
-
-
Optional
headers?: {
x-mosaic-signature: string;
x-mosaic-signature-key-version: number;
}
-
x-mosaic-signature: string
-
x-mosaic-signature-key-version: number
onError
- onError(error, messageId): Promise<void>
-
Parameters
-
error: Error
-
messageId: string
Returns Promise<void>
onPaused
- onPaused(messageId): Promise<void>
-
Returns Promise<void>
onReturn
- onReturn(message): Promise<void>
-
Parameters
-
message: {
fields?: {
exchange?: string;
replyCode?: number;
replyText?: string;
routingKey?: string;
};
properties?: {
messageId?: string;
};
}
-
Optional
fields?: {
exchange?: string;
replyCode?: number;
replyText?: string;
routingKey?: string;
}
-
Optional
exchange?: string
-
Optional
replyCode?: number
-
Optional
replyText?: string
-
Optional
routingKey?: string
-
Optional
properties?: {
messageId?: string;
}
-
Optional
messageId?: string
Returns Promise<void>
onSuccess
- onSuccess(messageId): Promise<void>
-
Returns Promise<void>
publish
- publish(aggregateId, payload, envelopeOverrides?, options?, eventSigning?): Promise<PublicationSession>
-
Parameters
-
aggregateId: string
-
payload: unknown
-
-
options: PublicationConfig = {}
-
Optional
eventSigning: Required<Pick<ValueObject<{
rmqChannelMax: (() => number);
rmqDevMiddleware: (() => boolean);
rmqEventSigningKeyVersion: (() => number);
rmqEventSigningKeyVersionsToRevoke: (() => number[]);
rmqEventSigningPrivateKey: (() => string);
rmqEventSigningPublicKey: (() => string);
rmqHost: (() => string);
rmqMgmtHost: (() => undefined | string);
rmqMgmtPort: (() => undefined | number);
rmqMgmtProtocol: (() => undefined | string);
rmqPassword: (() => string);
rmqPort: (() => number);
rmqProtocol: (() => string);
rmqUser: (() => string);
rmqVHost: (() => string);
rmqVHostAssert: (() => boolean);
}>, "rmqEventSigningPrivateKey" | "rmqEventSigningKeyVersion">>
Returns Promise<PublicationSession>
Handles publication of messages, including the generation of the message envelope object.