Skip to content

MQTT_Publish() return MQTTSuccess,but the message is not being published to broker successfuly #1900

Open
@zhengasif

Description

@zhengasif

hi teams
I'm using the latest version of embedded sdk in my arm-linux device. I found an error that MQTT_Publish() return MQTTSuccess,but in fact there are no messages in broker ,and after 5 seconds it returns MQTTKeepAliveTimeout because of the bad network condition.I set QOS0 for my msgs.
why it is like that in poor network condition?
my code is like below:
mqttStatus = MQTT_Publish( &AwsMqttContext,&outgoingPublishPackets[publishIndex].pubInfo,outgoingPublishPackets[publishIndex ].packetId);
if(mqttStatus!=MQTTSuccess )
{
printf("Failed to send PUBLISH packet to broker with error = %s.",MQTT_Status_strerror(mqttStatus));
returnStatus = EXIT_FAILURE;
cleanupOutgoingPublish( publishIndex );
}
else
{
printf( "PUBLISH sent for topic %.*s to broker with packet ID %u.\n\n",strlen(pub_topic),pub_topic,outgoingPublishPackets[ publishIndex ].packetId);
}
The log file is in the attachment.
sendnook

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions