axl_bool myqtt_conn_offline_pub ( MyQttCtx ctx,
const char *  client_identifier,
const char *  topic_name,
const axlPointer  app_message,
int  app_message_size,
MyQttQos  qos,
axl_bool  retain 

Allows to queue PUBLISH messages on local storage, associated to the provided client identifier, that will be sent once the connection is created after this operation.

ctxThe context where the operation takes place.
client_identifierThe client identifier where the message will be stored. Once a new connection is created with this client identifier, then those messages queued, along those unfinished in-flight messages, will be sent.
topic_nameThe name of the topic for the application message published.
app_messageThe application message to publish. From MyQtt's perspective, this is binary data that has a format that is only meaningful to the application on top using MQTT.
app_message_sizeThe size of the application message.
qosThe quality of service under which the message will be published. See MyQttQos. This function do not support MYQTT_QOS_SKIP_STORAGE. If provided the function will just fail.
retainEnable message retention for this published message. This way new subscribers will be able to get last published retained message.
The function returns axl_true in the case the message was queued, otherwise axl_false is returned. The function returns axl_false when the connection received is broken or topic name is NULL or it is bigger than 65535 bytes. The function will also return axl_false when provided MYQTT_QOS_SKIP_STORAGE on qos parameter.

NOTE: you can only queue a maximum of 65356 messages pending to be sent (which is the maximum packet identifier allowed) with QoS1 (MYQTT_QOS_1) or Qos2 (MYQTT_QOS_2). Of messages with QoS0 there's no protocol/API limit (apart from local physical storage available).

References msg, MYQTT_PUBLISH, MYQTT_QOS_0, MYQTT_QOS_SKIP_STORAGE, myqtt_storage_init_offline(), myqtt_storage_lock_pkgid_offline(), myqtt_storage_release_pkgid_offline(), and myqtt_storage_store_msg_offline().