MessageQueue class abstract

Abstract message queue that is used as a basis for specific message queue implementations.

Configuration parameters

  • name: name of the message queue
  • connection(s):
    • discovery_key: key to retrieve parameters from discovery service
    • protocol: connection protocol like http, https, tcp, udp
    • host: host name or IP address
    • port: port number
    • uri: resource URI or connection string with all parameters in it
  • credential(s):
    • store_key: key to retrieve parameters from credential store
    • username: user name
    • password: user password
    • access_id: application access id
    • access_key: application secret key


  • *:logger:*:*:1.0 (optional) ILogger components to pass log messages
  • *:counters:*:*:1.0 (optional) ICounters components to pass collected measurements
  • *:discovery:*:*:1.0 (optional) IDiscovery components to discover connection(s)
  • *:credential-store:*:*:1.0 (optional) ICredentialStore componetns to lookup credential(s)
Implemented types


MessageQueue([String? name, MessagingCapabilities? capabilities])
Creates a new instance of the message queue.


capabilities MessagingCapabilities
getter/setter pair
connectionResolver ↔ ConnectionResolver
getter/setter pair
counters ↔ CompositeCounters
getter/setter pair
credentialResolver ↔ CredentialResolver
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
logger ↔ CompositeLogger
getter/setter pair
name String
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited


abandon(MessageEnvelope message) Future
Returnes message into the queue and makes it available for all subscribers to receive it again. This method is usually used to return a message which could not be processed at the moment to repeat the attempt. Messages that cause unrecoverable errors shall be removed permanently or/and send to dead letter queue.
beginListen(String? correlationId, IMessageReceiver receiver) → void
Listens for incoming messages without blocking the current thread.
checkOpen(String? correlationId) → void
Checks if the queue has been opened and throws an exception is it's not.
clear(String? correlationId) Future
Clears component state.
close(String? correlationId) Future
Closes component and frees used resources.
complete(MessageEnvelope message) Future
Permanently removes a message from the queue. This method is usually used to remove the message after successful processing.
configure(ConfigParams config) → void
Configures component by passing configuration parameters.
endListen(String? correlationId) → void
Ends listening for incoming messages. When this method is call listen unblocks the thread and execution continues.
getCapabilities() MessagingCapabilities
Gets the queue capabilities
getName() String
Gets the queue name
isOpen() bool
Checks if the component is opened.
listen(String? correlationId, IMessageReceiver receiver) → void
Listens for incoming messages and blocks the current thread until queue is closed.
moveToDeadLetter(MessageEnvelope message) Future
Permanently removes a message from the queue and sends it to dead letter queue.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
open(String? correlationId) Future
Opens the component.
openWithParams(String? correlationId, ConnectionParams? connection, CredentialParams? credential) Future
Opens the component with given connection and credential parameters.
peek(String? correlationId) Future<MessageEnvelope?>
Peeks a single incoming message from the queue without removing it. If there are no messages available in the queue it returns null.
peekBatch(String? correlationId, int messageCount) Future<List<MessageEnvelope?>>
Peeks multiple incoming messages from the queue without removing them. If there are no messages available in the queue it returns an empty list.
readMessageCount() Future<int>
Reads the current number of messages in the queue to be delivered.
receive(String? correlationId, int waitTimeout) Future<MessageEnvelope?>
Receives an incoming message and removes it from the queue.
renewLock(MessageEnvelope message, int lockTimeout) Future
Renews a lock on a message that makes it invisible from other receivers in the queue. This method is usually used to extend the message processing time.
send(String? correlationId, MessageEnvelope envelope) Future
Sends a message into the queue.
sendAsObject(String? correlationId, String messageType, dynamic message) Future
Sends an object into the queue. Before sending the object is converted into JSON string and wrapped in a MessageEnvelope.
setReferences(IReferences references) → void
Sets references to dependent components.
toString() String
Gets a string representation of the object.


operator ==(Object other) bool
The equality operator.