MessageEnvelope class

Allows adding additional information to messages. A correlation id, message id, and a message type are added to the data being sent/received. Additionally, a MessageEnvelope can reference a lock token.

Side note: a MessageEnvelope's message is stored as string, so strings are converted using utf8 conversions.

Constructors

MessageEnvelope(String correlationId, String messageType, dynamic message)
Creates a new MessageEnvelope, which adds a correlation id, message id, and a type to the data being sent/received. [...]

Properties

correlation_id ↔ String
read / write
message ↔ String
read / write
message_id ↔ String
read / write
message_type ↔ String
read / write
sent_time ↔ DateTime
read / write
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

getMessageAsJson() → dynamic
Returns the value that was stored in this message as a JSON string. [...]
getMessageAsString() → String
Returns the information stored in this message as a UTF-8 encoded string.
getReference() → dynamic
Returns the lock token that this MessageEnvelope references.
setMessageAsJson(Map<String, dynamic> value) → void
Stores the given value as a JSON string. [...]
setMessageAsString(String value) → void
Stores the given string. [...]
setReference(dynamic value) → void
Sets a lock token reference for this MessageEnvelope. [...]
toString() → String
Convert's this MessageEnvelope to a string, using the following format: [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited