Previously, we saw how to use Iron push queues with Laravel. All we needed to do was set up an Iron account, add a subscriber URL, push a message to queue, and receive the message.
The way Laravel supports Iron push queues out-of-the-box is amazing, but there are always limitations. In this article we focus on those limitations and learn to tackle them.
Examples
There are three possible scenarios:
You received the message and you finished the job successfully.
- You need provision to tell Iron that the job was completed successfully and it needs to delete it from the queue.
You received the message and something went wrong. Basically, your job was not successful.
- In this case we should tell Iron that we failed and it should retry or if you couldn’t tell Iron anything, it should be clever enough to retry the job i.e., push the same message again to your subscriber after some time.
You received the message, but your job is a long running process (something which takes more than a minute)
- Iron should wait longer before it resends the message.
These are all practical scenarios and you will face them on a daily basis. And yes, you need to cover these cases in your applications.
It’s possible to use Iron to its full power if we use the Iron MQ PHP Library. During setup we included "iron-io/iron_mq": "1.4.6" in our composer file. The code for the same is hosted at https://github.com/iron-io/iron_mq_php. Let’s take a peek into the documentation and try to understand how to use this library.
Continue reading %IronMQ and Laravel: Delays and Retries%
more
{ 0 comments... » IronMQ and Laravel: Delays and Retries read them below or add one }
Post a Comment