PHPackages                             mohan-devstack/magento2-product-queue-save - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. mohan-devstack/magento2-product-queue-save

ActiveMagento2-module[Queues &amp; Workers](/categories/queues)

mohan-devstack/magento2-product-queue-save
==========================================

Magento 2 module — Save all product types asynchronously via message queue (simple, configurable, grouped, bundle, downloadable). No browser timeouts.

v1.0.0(1mo ago)101MITPHPPHP &gt;=8.1

Since Jul 10Pushed 1mo agoCompare

[ Source](https://github.com/mohan-devstack/magento2-async-product-save)[ Packagist](https://packagist.org/packages/mohan-devstack/magento2-product-queue-save)[ RSS](/packages/mohan-devstack-magento2-product-queue-save/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Mohan\_ProductQueueSave — Magento 2 Async Product Save
======================================================

[](#mohan_productqueuesave--magento-2-async-product-save)

A Magento 2 module that adds a **"Save via Queue &amp; Close"** button to the admin product edit page. Instead of saving the product synchronously (which can time out on large catalogues or complex products), it pushes the save operation onto Magento's message queue and processes it in the background via a long-running PHP consumer.

---

Features
--------

[](#features)

- Async product save via `Magento_MessageQueue` — no browser timeout
- Full support for **all product types**:
    - **Simple products** — all attributes, custom options, tier prices, links
    - **Configurable products** — variation creation and sync (status, price, qty, images per child)
    - **Grouped products** — associated product links with default quantities
    - **Bundle products** — bundle options and selections
    - **Downloadable products** — link files, link samples, and standalone samples
    - **Virtual products** — treated the same as simple
- Media gallery — new uploads, role assignment, image removal
- Tier prices
- Custom options
- Related / upsell / cross-sell links
- Category assignments
- Website assignments
- Stock (qty, in-stock flag)
- Multiselect attribute values
- Admin queue log grid — see pending, processing, success, and failed jobs
- Nightly cleanup cron — removes completed queue messages automatically (keeps DB size in check)
- CLI status command: `bin/magento mohan:product-queue:status`

---

Requirements
------------

[](#requirements)

DependencyVersionPHP≥ 8.1Magento2.4.x`magento/module-catalog`\*`magento/module-configurable-product`\*`magento/module-catalog-inventory`\*---

Installation
------------

[](#installation)

### Via Composer (recommended)

[](#via-composer-recommended)

```
composer require mohan-devstack/magento2-product-queue-save
php bin/magento module:enable Mohan_ProductQueueSave
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
```

### Manual

[](#manual)

1. Copy the module files into `app/code/Mohan/ProductQueueSave/`
2. Run:

```
php bin/magento module:enable Mohan_ProductQueueSave
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
```

---

Configuration
-------------

[](#configuration)

Go to **Stores → Configuration → Mohan → Product Queue Save**.

SettingDescriptionDefaultEnable ModuleShow/hide the queue save buttonYesMax Retry AttemptsHow many times a failed job is retried3---

Starting the Queue Consumer
---------------------------

[](#starting-the-queue-consumer)

The consumer is a long-running PHP process. Start it on your server:

```
php bin/magento queue:consumers:start mohan.product.queue.save.consumer
```

> **Important:** Run the consumer as the **same OS user as your web server** (typically `www-data`). Uploaded files in the media tmp directory are owned by the web server user — the consumer needs write access to that directory to move files to permanent storage.

For production, manage it with **Supervisor** so it restarts automatically on crash:

```
[program:mohan_product_queue]
command=php /var/www/html/magento/bin/magento queue:consumers:start mohan.product.queue.save.consumer
user=www-data
autostart=true
autorestart=true
stderr_logfile=/var/log/mohan_product_queue.err.log
stdout_logfile=/var/log/mohan_product_queue.out.log
```

---

Usage
-----

[](#usage)

1. Open any product in the Magento admin.
2. Make your changes.
3. Click **"Save via Queue &amp; Close"** (next to the standard Save button).
4. You are redirected to the product grid immediately — the save happens in the background.
5. Monitor progress at **Catalog → Product Queue Log**.

---

Queue Log Grid
--------------

[](#queue-log-grid)

The admin grid at **Catalog → Product Queue Log** shows every queued save with:

- Product ID and SKU
- Status: `pending` → `processing` → `success` / `failed`
- Timestamp and error message (on failure)

---

How It Works
------------

[](#how-it-works)

```
[Admin clicks button]
        │
        ▼
Controller (Queue/Save)
  → Collects full product POST data
  → Publishes JSON message to queue topic: mohan.product.queue.save
  → Returns success immediately → browser redirects to grid
        │
        ▼
Queue Consumer (long-running CLI process)
  → Unserializes message
  → Loads existing product from repository
  → Applies: stock, tier prices, links, custom options, gallery, categories
  → Runs type-specific processors:
      • ConfigurableProcessor  — creates/syncs child variations and images
      • GroupedProcessor       — saves associated links with default qty
      • BundleProcessor        — saves bundle options and selections
      • DownloadableProcessor  — moves link/sample files and saves extension attributes
  → productRepository->save()
  → Marks log entry as success / failed

```

### Why not just use standard save?

[](#why-not-just-use-standard-save)

Magento's synchronous product save can take 30–120 seconds for:

- Configurable products with 50+ variations
- Products with large media galleries (100+ images)
- Catalogues with deep category trees
- Downloadable products with multiple file links

This module moves that work off the HTTP request entirely.

---

Database Table
--------------

[](#database-table)

The module creates one table: **`mohan_product_queue_log`**

ColumnTypeDescription`log_id`intPrimary key`message_id`varchar(64)Unique queue message ID`product_id`intCatalog product entity ID`sku`varchar(64)Product SKU`status`varchar(32)pending / processing / success / failed / retry`store_id`smallintStore scope of the save`admin_user_id`intAdmin who triggered the save`error_message`textError detail on failure`retry_count`smallintNumber of retries attempted`created_at`timestampWhen the job was queued`processed_at`timestampWhen it completed---

Cleanup Cron
------------

[](#cleanup-cron)

A nightly cron (`0 3 * * *`) automatically:

1. Deletes completed `queue_message` / `queue_message_status` rows for this module's queue — `queue_message.body` is `longtext` and grows large with image data.
2. Trims `mohan_product_queue_log`: success entries older than **30 days**, failed/retry entries older than **90 days**.

---

CLI Command
-----------

[](#cli-command)

Check queue status from the command line:

```
php bin/magento mohan:product-queue:status
```

---

Known Limitations
-----------------

[](#known-limitations)

- **New image uploads**: The source `.tmp` file must still exist on disk when the consumer runs. If Magento's `remove_old_catalog_images_from_cache` cron cleans the tmp directory before the consumer processes the message, the image will be skipped (product still saves, just without the new image). This is unlikely in practice but worth noting for very busy queues.
- **Retry**: Automatic retry is intentionally disabled. A retry would re-publish the queue message, but the original payload is not stored in the log table, so retrying with an empty payload would wipe tier prices and product links. Manual re-save is the safe path until full payload persistence is implemented.

---

License
-------

[](#license)

MIT © [Mohan](mailto:mohandevstack@gmail.com)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/631a068a01ba920c5b7f8e8e9b741f54538930c5e65495ad2974d55c628debdc?d=identicon)[mohan-devstack](/maintainers/mohan-devstack)

---

Top Contributors

[![mohan-devstack](https://avatars.githubusercontent.com/u/301720141?v=4)](https://github.com/mohan-devstack "mohan-devstack (10 commits)")

### Embed Badge

![Health badge](/badges/mohan-devstack-magento2-product-queue-save/health.svg)

```
[![Health](https://phpackages.com/badges/mohan-devstack-magento2-product-queue-save/health.svg)](https://phpackages.com/packages/mohan-devstack-magento2-product-queue-save)
```

###  Alternatives

[buckaroo/magento2

Buckaroo Magento 2 extension

32426.0k8](/packages/buckaroo-magento2)[mollie/magento2

Mollie Payment Module for Magento 2

1142.0M17](/packages/mollie-magento2)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50406.2k23](/packages/dotdigital-dotdigital-magento2-extension)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69362.0k](/packages/run-as-root-magento2-prometheus-exporter)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1015.1k29](/packages/loki-magento2-components)[loki/magento2-admin-components

Admin Panel grids and forms created via Loki Components

178.3k9](/packages/loki-magento2-admin-components)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
