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.

NewTestMessageReceiver() *TestMessageReceiver

Properties

GetMessages

Gets the list of received messages.

(c *TestMessageReceiver) GetMessages() []queues.MessageEnvelope

GetMessageCount

Gets the received message count.

(c *TestMessageReceiver) GetMessageCount() int

  • returns: int - number of messages

Instance methods

Clear

Clears all received messagers.

(c *TestMessageReceiver) Clear(ctx context.Context) error

  • context: IContext - a context to trace execution through a call chain.

ReceiveMessage

Receives incoming message from the queue.

See also MessageEnvelope, IMessageQueue

(c *TestMessageReceiver) ReceiveMessage(ctx context.Context, envelope *queues.MessageEnvelope, queue queues.IMessageQueue) (err error)