Implement Asynchronous Functionality in Magento 1.7

event-observermagento-1.7

I want to add asynchronous functionality into magento. I am using events to do run some backend processes and these processes can sometime cause long delays. This under some circumstances become unacceptable especially when customer is trying to place an order. Now I want observer to run independently of event. I tried using mage-resque to use queues but it adds one more point of failure and there is no way to know if it is widely used. Are there any job queues that can easily be integrated with magento which are actively updated and don't overuse database? I have tried using magento SNS to send customer SMS but again I don't know if there is a precedent. The truth is I wouldn't want to experiment at this stage without knowing consequence. Any help would be appreciated

Best Answer

There is no 'standard' approach to queuing within Magento per se. As you've probably seen there's a number of modules floating around that try and help with different messaging systems, for instance Lilmuckers_Queue. My guess is that only a small portion Magento projects end up needing some slow process sent to a job queue. Any performance gain for something like offloading an e-mail during checkout isn't worth the effort of the implementation and maintenance.

One thing to keep in mind is that its possible to have a message queue that is "highly available" thus not a single point of failure. If you have the time/resources it's possible to configure Redis (and other MQ servers) for failover. If you don't mind being "locked in" to AWS then using SQS would be a good option, especially if you're already using some of their services.

Which route one ends up going ultimately depends on the project, the technical team and organization. An internal engineering team of a large merchant would likely have the proficiency and staff required to implement such a solution. A freelancer or agency implementing a project for a small-ish client probably shouldn't over complicate the architecture (especially for the next team/person who ends up with the project).

Related Topic