CS-Cart Queue Handler - Webkul Blog - The Legend of Hanuman

CS-Cart Queue Handler – Webkul Blog


The Queue Handler add-on provides a flexible and efficient solution for managing background tasks in CS-Cart.

It supports two queue backends—Database and RabbitMQ—allowing merchants to choose the best solution for their business needs.

This dual-queue system enables asynchronous job processing, improving system performance and scalability.

Table of Contents

  • Multiple Queue Backend Support: Choose between Database or RabbitMQ.
  • Batch Processing Capabilities: Process multiple jobs in a single execution cycle.
  • Automatic Retry Mechanism: Failed jobs are retried up to 3 times before being marked as failed.
  • Detailed Logging System: Maintain comprehensive logs for debugging and performance monitoring.
  • Scalable Architecture: Supports high-volume transactions and distributed environments.
  • Improved Performance: Efficiently handle bulk operations without affecting the front-end experience.
  • Reliable Processing: A built-in retry mechanism ensures job completion.
  • Scalability: Supports both single-server and distributed architectures.

1. When you download the “Queue Handler”, you’ll get one zip file and the install.txt file. Read it carefully and follow it. After that, install the zip file.

addon
queue

Once installed, the Queue Handler needs to be configured based on your preferred queue backend:

  • Access add-on settings through Add-ons → Downloaded add-ons → Queue Handler → Settings.
  • Choose the queue handler type: Database or RabbitMQ.
  • Configure batch processing using the ‘Items Count’ parameter.
  • If using RabbitMQ, provide the necessary connection settings (hostname, port, credentials, etc.).
  • If using a Database, the system automatically generates the required tables for job management.

The Queue Handler integrates seamlessly with multiple CS-Cart add-ons, including:

The queue system tracks job execution through various states:

  • pending: The system places a job in the queue, waiting for execution.
  • in_process: The system is currently executing the job.
  • failed: The system retries the job up to three times after a failed execution before marking it as failed.

Data Processing

Using Database:

The system creates each job with a pending status when using the database as a queue handler for data import.

Database queue handler table for pending state

A job worker is responsible for processing these jobs. To trigger the job worker manually, run the following command in the terminal:

curl -k "{{baseurl}}/index.php?dispatch=queue_handler.import_data"

Upon execution, the job status changes to in_process.

Database queue handler table for in_process state

If the system successfully completes a job, it removes the job from the database.

However, if an error occurs during processing, the system updates the job status to ‘failed’ and retries it. The system allows each job a maximum of three processing attempts.

Database queue process is completed

Using RabbitMQ:

When using RabbitMQ as the queue handler for data import, the system stores the data as messages in the RabbitMQ queue.

RabbitMQ queue dashboard stats

A job worker is responsible for processing and importing data from the RabbitMQ queue. To trigger this job worker manually, run the following command in the terminal:

curl -k "{{baseurl}}/index.php?dispatch=queue_handler.import_data"
RabbitMQ queue dashboard
RabbitMQ queue is processing

The Queue Handler is perfect for handling resource-intensive background processes such as:

  • Bulk Product Updates: Process large-scale product imports and updates efficiently.
  • Order Processing: Handle high-volume order operations without delays.
  • Data Synchronization: Sync data across different platforms in real time.

The Queue Handler add-on for CS-Cart is a robust and scalable solution designed to streamline background task management.

Whether running a single-server setup or a complex distributed environment, this add-on provides the flexibility, reliability, and performance needed to optimize asynchronous job processing.

Offering support for both Database and RabbitMQ ensures that CS-Cart users can select the best queueing system that aligns with their operational requirements.

Support:

Still have any issues, feel free to add a ticket and let us know your views to make the module better http://webkul.uvdesk.com

Besides this, you can explore our CS-Cart Development Services and Quality CS-Cart add-ons.

Current Product Version – 1.0


Share this content:

I am a passionate blogger with extensive experience in web design. As a seasoned YouTube SEO expert, I have helped numerous creators optimize their content for maximum visibility.

Leave a Comment