TestMessageReceiver

Class used to receive a message, obtain a list of received messages and the number of received messages, and to clear the message list.

Implements: IMessageReceiver, ICleanable

Description

The TestMessageReceiver allows you to receive a message, obtain a list of received messages and the number of received messages, and to clear the message list.

Constructors

Creates a TestMessageReceiver component.

public constructor()

Properties

messages

Gets the list of received messages.

public messages(): MessageEnvelope[]

messageCount

Gets the received message count.

public messageCount(): number

  • returns: number - number of messages

Instance methods

clear

Clears all received messagers.

public clear(correlationId: string): Promise<void>

  • correlationId: string - (optional) transaction id to trace execution through call chain.

receiveMessage

Receives incoming message from the queue.

See also MessageEnvelope, IMessageQueue

public receiveMessage(envelope: MessageEnvelope, queue: IMessageQueue): Promise<void>