Client wrapper shall do a dedicated treatment for Bad_TooManyPublishRequests
The specification part 4 v1.04 states that:
When a Server receives a new Publish request that exceeds its limit it shall de-queue the oldest Publish request and return a response with the result set to Bad_TooManyPublishRequests. If a Client receives this Service result for a Publish request it shall not issue another Publish request before one of its outstanding Publish requests is returned from the Server.
The current client state machine implementation does not restrain sending of new Publish requests in this case as the current treatment does not differentiate the status code of response from the Timeout status code (in this case sending a new request is recommended).
When receiving Bad_TooManyPublishRequests it might be possible:
- to adapt the number of tokens used by client (reduce if >= 1)
- to inhibit new PublishRequest sending until next PublishResponse received (if used token >= 1)