QMqttPublishProperties#
The QMqttPublishProperties
class represents configuration options for sending or receiving a message. More…
Synopsis#
Functions#
def
availableProperties
()def
contentType
()def
correlationData
()def
messageExpiryInterval
()def
payloadFormatIndicator
()def
responseTopic
()def
setContentType
(type)def
setCorrelationData
(correlation)def
setMessageExpiryInterval
(interval)def
setPayloadFormatIndicator
(indicator)def
setResponseTopic
(topic)def
setSubscriptionIdentifiers
(ids)def
setTopicAlias
(alias)def
setUserProperties
(properties)def
subscriptionIdentifiers
()def
topicAlias
()def
userProperties
()
Detailed Description#
Invoking publish()
to send a message to a broker can include QMqttPublishProperties
to provide additional arguments on how the message should be treated on the broker.
Furthermore receiving a message by an instantiated subscription might contain publish properties which have been forwarded or adapted by the server.
Note
Publish properties are part of the MQTT 5.0 specification and cannot be used when connecting with a lower protocol level. See ProtocolVersion
for more information.
- class PySide6.QtMqtt.QMqttPublishProperties#
PySide6.QtMqtt.QMqttPublishProperties(arg__1)
- Parameters
- PySide6.QtMqtt.QMqttPublishProperties.PublishPropertyDetail#
(inherits enum.Flag
) This enum type specifies the available properties set by the server or the client when creating a message.
Constant
Description
QMqttPublishProperties.None
No property has been specified.
QMqttPublishProperties.PayloadFormatIndicator
The type of content of the message.
QMqttPublishProperties.MessageExpiryInterval
The duration a message is valid.
QMqttPublishProperties.TopicAlias
The topic alias for this message.
QMqttPublishProperties.ResponseTopic
The topic the receipient should respond to.
QMqttPublishProperties.CorrelationData
An identifier of the response message.
QMqttPublishProperties.UserProperty
Additional properties set by the user.
QMqttPublishProperties.SubscriptionIdentifier
An identifier of subscriptions matching the publication.
QMqttPublishProperties.ContentType
A description of the content of the message.
- PySide6.QtMqtt.QMqttPublishProperties.availableProperties()#
- Return type
PublishPropertyDetails
Returns the available properties specified in this instance. When a message is created, it does not need to include all properties. This function serves as an indicator of those properties which have been explicitly set.
- PySide6.QtMqtt.QMqttPublishProperties.contentType()#
- Return type
str
Returns the content type of the message.
See also
- PySide6.QtMqtt.QMqttPublishProperties.correlationData()#
- Return type
Returns the correlation data.
See also
- PySide6.QtMqtt.QMqttPublishProperties.messageExpiryInterval()#
- Return type
int
Returns the message expiry interval. This value specifies the number of seconds a server is allowed to forward the message. If the interval expires, the server must delete the message and abort publishing it.
See also
- PySide6.QtMqtt.QMqttPublishProperties.payloadFormatIndicator()#
- Return type
Returns the payload format indicator.
See also
- PySide6.QtMqtt.QMqttPublishProperties.responseTopic()#
- Return type
str
Returns the response topic a user should use as a follow up to a request.
See also
- PySide6.QtMqtt.QMqttPublishProperties.setContentType(type)#
- Parameters
type – str
Sets the content type of the message to type
.
See also
- PySide6.QtMqtt.QMqttPublishProperties.setCorrelationData(correlation)#
- Parameters
correlation –
PySide6.QtCore.QByteArray
Sets the correlation data to correlation
.
See also
- PySide6.QtMqtt.QMqttPublishProperties.setMessageExpiryInterval(interval)#
- Parameters
interval – int
Sets the message expiry interval to interval
.
See also
- PySide6.QtMqtt.QMqttPublishProperties.setPayloadFormatIndicator(indicator)#
- Parameters
indicator –
PayloadFormatIndicator
Sets the payload format indicator to indicator
.
See also
- PySide6.QtMqtt.QMqttPublishProperties.setResponseTopic(topic)#
- Parameters
topic – str
Sets the response topic to topic
.
See also
- PySide6.QtMqtt.QMqttPublishProperties.setSubscriptionIdentifiers(ids)#
- Parameters
ids –
Sets the subscription identifiers to ids
.
See also
- PySide6.QtMqtt.QMqttPublishProperties.setTopicAlias(alias)#
- Parameters
alias –
quint16
Sets the topic alias for publishing a message to alias
. A topic alias value must be greater than zero and less than the maximum topic alias specified by the server.
See also
topicAlias()
maximumTopicAlias()
- PySide6.QtMqtt.QMqttPublishProperties.setUserProperties(properties)#
- Parameters
properties –
QMqttUserProperties
Sets the user properties of a message to properties
.
See also
- PySide6.QtMqtt.QMqttPublishProperties.subscriptionIdentifiers()#
- Return type
Returns the subscription identifiers of subscriptions matching the topic filter of the message.
See also
- PySide6.QtMqtt.QMqttPublishProperties.topicAlias()#
- Return type
quint16
Returns the topic alias used for publishing a message.
See also
- PySide6.QtMqtt.QMqttPublishProperties.userProperties()#
- Return type
QMqttUserProperties
Returns the user properties of a message.
See also