MqttSubscribeMessage class

The subscribe message is sent from the client to the broker to create one or more subscriptions. Each subscription registers the client’s interest in one or more topics. The broker sends publish messagesto the client to forward application messages that were published to topics that match these subscriptions.

The subscribe message also specifies (for each subscription) the maximum QoS with which the broker can send application messages to the client.

Inheritance

Constructors

MqttSubscribeMessage()
Initializes a new instance of the MqttSubscribeMessage class.

Properties

hashCode int
The hash code for this object.
no setterinherited
The header of the MQTT Message. Contains metadata about the message
getter/setter pairinherited
isValid bool
Is valid, if not valid the subscription message cannot be sent to the broker. At least one topic must be present in the payload and the message identifier must be set.
no setteroverride
messageIdentifier int
Set the message identifier
no getter
payload MqttSubscribePayload?
Gets the payload contents.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
variableHeader MqttSubscribeVariableHeader?
Gets the variable header contents.
no setter

Methods

getWriteLength() int
Write length
isDuplicate() MqttSubscribeMessage
Sets the duplicate flag for the message to indicate its a duplicate of a previous message type with the same message identifier.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readFrom(MqttByteBuffer messageStream) → void
Reads a message from the supplied stream. Not implemented, message is send only.
override
toString() String
A string representation of this object.
override
toSubscription(MqttSubscription subscription) MqttSubscribeMessage
Adds a new subscription with the specified subscription
toSubscriptionList(List<MqttSubscription> subscriptions) MqttSubscribeMessage
Adds a new subscription with the specified subscription list
toTopic(String topic) MqttSubscribeMessage
Adds a new subscription topic with the default Qos level.
toTopicWithOption(String? topic, MqttSubscriptionOption option) MqttSubscribeMessage
Adds a new subscription with the specified subscription optionMqttSubscriptionOption.
toTopicWithQos(String? topic, MqttQos? withQos) MqttSubscribeMessage
Adds a new subscription topic with the specified Qos levelMqttQos.
withSubscriptionIdentifier(int identifier) MqttSubscribeMessage
Subscription identifier
withUserProperties(List<MqttUserProperty>? properties) MqttSubscribeMessage
User properties
withUserProperty(MqttUserProperty property) MqttSubscribeMessage
User property
writeTo(MqttByteBuffer messageStream) → void
Writes the message to the supplied stream.
override

Operators

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