PySide6.QtMqtt.QMqttPublishProperties¶
- class QMqttPublishProperties¶
The
QMqttPublishProperties
class represents configuration options for sending or receiving a message. More…Synopsis¶
Methods¶
def
__init__()
def
contentType()
def
responseTopic()
def
setContentType()
def
setTopicAlias()
def
topicAlias()
def
userProperties()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
Invoking
publish()
to send a message to a broker can includeQMqttPublishProperties
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 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.
- __init__()¶
- __init__(arg__1)
- Parameters:
arg__1 –
QMqttPublishProperties
- availableProperties()¶
- Return type:
Combination of
PublishPropertyDetail
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.
- contentType()¶
- Return type:
str
Returns the content type of the message.
See also
- correlationData()¶
- Return type:
Returns the correlation data.
See also
- 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
- payloadFormatIndicator()¶
- Return type:
Returns the payload format indicator.
See also
- responseTopic()¶
- Return type:
str
Returns the response topic a user should use as a follow up to a request.
See also
- setContentType(type)¶
- Parameters:
type – str
Sets the content type of the message to
type
.See also
- setCorrelationData(correlation)¶
- Parameters:
correlation –
QByteArray
Sets the correlation data to
correlation
.See also
- setMessageExpiryInterval(interval)¶
- Parameters:
interval – int
Sets the message expiry interval to
interval
.See also
- setPayloadFormatIndicator(indicator)¶
- Parameters:
indicator –
PayloadFormatIndicator
Sets the payload format indicator to
indicator
.See also
- setResponseTopic(topic)¶
- Parameters:
topic – str
Sets the response topic to
topic
.See also
- setSubscriptionIdentifiers(ids)¶
- Parameters:
ids – .list of quint32
Sets the subscription identifiers to
ids
.See also
- setTopicAlias(alias)¶
- Parameters:
alias – int
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()
- setUserProperties(properties)¶
- Parameters:
properties –
QMqttUserProperties
Sets the user properties of a message to
properties
.See also
- subscriptionIdentifiers()¶
- Return type:
.list of quint32
Returns the subscription identifiers of subscriptions matching the topic filter of the message.
See also
- topicAlias()¶
- Return type:
int
Returns the topic alias used for publishing a message.
See also
- userProperties()¶
- Return type:
QMqttUserProperties
Returns the user properties of a message.
See also