aws / aws-iot-device-sdk-embedded-C

SDK for connecting to AWS IoT from a device using embedded C.
MIT License
986 stars 634 forks source link

Continuously "An MQTT session with broker is re-established. Resending unacked publishes" #1914

Closed Gwanyoung-K closed 2 months ago

Gwanyoung-K commented 2 months ago

Hi.

I faced continuously messages.

An MQTT session with broker is re-established. Resending unacked publishes. MQTT connection successfully established with broker.
An MQTT session with broker is re-established. Resending unacked publishes. MQTT connection successfully established with broker.
An MQTT session with broker is re-established. Resending unacked publishes. MQTT connection successfully established with broker.

I'll let you know logs on my process.

  1. MQTT connection successfully established with broker.
  2. A clean MQTT connection is established. Cleaning up all the stored outgoing publishes.
  3. SUBSCRIBE sent for topic resp/xxx/init_connection to broker.
  4. Sending Publish to the MQTT topic cmd/xxx/init_connection.
  5. PUBLISH sent for topic cmd/xxx/init_connection to broker with packet ID 2.
  6. Incomimg topic( resp/xxx/init_connection ) packetid ( 1 )
  7. device go sleep and wake up
  8. MQTT connection successfully established with broker.
  9. A clean MQTT connection is established. Cleaning up all the stored outgoing publishes.
  10. An MQTT session with broker is re-established. Resending unacked publishes.
  11. MQTT connection successfully established with broker.
  12. An MQTT session with broker is re-established. Resending unacked publishes.
  13. MQTT connection successfully established with broker.
  14. An MQTT session with broker is re-established. Resending unacked publishes.
  15. continue these logs.

I don't know why the handlePublishResend function is running. In this situation, how can I connect a new session?

Gwanyoung-K commented 2 months ago

It's not issue. Sorry, My subscribe function( return false ) caused this bug at 'subscribePublishLoop()'.