You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, when I run the subscribe_publish_sample with a single publish, the subscribe callback never runs. The subscribe callback gets invoked x - 1 times, where x is set via the command-line and is represented as publishCount in the code. However the CloudWatch log shows the correct number of x published messages, so it appears to just not be sending back from the broker to the local client for the first published message.
As I'm adapting this sample for my own use, and would like to understand if this is a bug or expected behavior.
Hi @cbumgard,
Its a bug in the sample. The loop that is doing publish exits here without waiting for the last set of messages to be received. I have made a note of this and will improve the sample for the next release. Until then, you should be able to resolve it by simply adding an aws_iot_mqtt_yield after the loop ends to catch any messages that have not been received yet.
Thank you for pointing this out. Please let us know if you have further questions.
Hi there, when I run the
subscribe_publish_sample
with a single publish, the subscribe callback never runs. The subscribe callback gets invokedx - 1
times, wherex
is set via the command-line and is represented aspublishCount
in the code. However the CloudWatch log shows the correct number ofx
published messages, so it appears to just not be sending back from the broker to the local client for the first published message.As I'm adapting this sample for my own use, and would like to understand if this is a bug or expected behavior.
Here is example output:
x=1 does not show the subscribe callback:
Shows (x - 1) messages in subscribe callback:
The text was updated successfully, but these errors were encountered: