phpxmppxmpphp

Error 503 after 10 to 15 XMPP messages


I have written an XMPP daemon (using JAXL) for sending and recieving messages which seems to work OK except for one issue.

I can successfully send 10 to 15 messages to the users I want to send to, and then after that any message I send comes back with <message type='error' ...><error code='503' type='cancel'></error></message>

I am using Google's talk servers to send from a Google Apps domain to another Google Apps domain.

Without posting all my code does anyone have any ideas what may be causing this. The bit that puzzles me is that I can send 10 to 15 messages first before it stops.


Solution

  • Sounds like you are hitting a rate-limiter. From the HTTP spec:

    10.5.4 503 Service Unavailable

    The server is currently unable to handle the request due to a
    temporary overloading or maintenance of the server. The implication
    is that this is a temporary condition which will be alleviated after
    some delay. If known, the length of the delay MAY be indicated in a
    Retry-After header. If no Retry-After is given, the client SHOULD
    handle the response as it would for a 500 response.

    A well-behaved service, which I would expect most of Google's to be, would be correct in returning such a response if it was rate-limiting something.