IronMQ Long Polling

Another one of our most requested features is now out in the wild: long polling. Long polling reduces the number of requests you need to make on an empty queue by not returning immediately when there are no messages available. Instead, IronMQ will wait until a message becomes available or until the "wait" time has passed (maximum 30 seconds).

This feature is really easy to use, just add a "wait" parameter to your GET messages request. The wait parameter is a number between 0 and 30, representing how many seconds to wait. For example, using the Ruby client:

Other clients/languages will make use of a similar parameter.

You can read more about long polling in the API Documentation.

Bonus Feature:  Get-Delete as One Operation

We've also added another often requested feature. You can now get and delete messages in one request by passing "delete=true" in the URL of your request.

Typical usage of IronMQ is to get a message in one request and then delete it in a separate request to acknowledge that you're done with it. In some instances, however, developers do not need the assurance that a message has been successfully processed and want to avoid the extra delete request, and so now they can.

Using the Ruby client, it would look like the following:

Warning: Don't use this if you need to ensure a message has been processed. If this is the case, then stick with the two step get-delete paradigm 

As always, let us know what you think in the comments below or shoot us a note via our support channel.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.