Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Deduplication Laravel Package

rabbitevents/deduplication

A Laravel package that adds deduplication to RabbitEvents, helping prevent duplicate RabbitMQ messages from being processed more than once. It provides a simple layer for idempotent event handling and safer consumers.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: This package fits Laravel services already using rabbitevents/listener ^10.0 and a shared Laravel cache store. It addresses a real at-least-once delivery problem: duplicate handling after a lost acknowledgement or worker restart. The design is intentionally narrow and operationally sensible: deduplication state lives in the cache layer, requires no RabbitMQ plugin, and scopes IDs per queue so a message routed to multiple queues is still processed once per queue. It is not an exactly-once guarantee; listeners with side effects must remain idempotent. Teams on RabbitEvents 9.x publishers will not get deduplication because those messages carry no ID.

Integration feasibility: Low application-code integration effort: composer require rabbitevents/deduplication, configure RABBITEVENTS_DEDUPLICATION_STORE, and ensure the selected cache store exists in config/cache.php. The main integration work is environmental and operational: all workers for a queue must share the same cache store, and the store must be production-grade (redis, database, or memcached; not file/array). The package’s fail-fast behavior for a missing cache configuration is helpful for catching misconfiguration at worker start. The silent-degradation behavior when the store is unreachable is a deliberate availability trade-off but needs operational visibility.

Technical risk: Medium. The package reduces duplicate side effects but does not eliminate them. Risks include cache eviction or key expiry causing re-processing, cache outage disabling deduplication with only a warning, inconsistent cache configuration across workers, and unexpected volume of deduplication keys in the shared cache. Partial-success and worker-death scenarios are explicitly called out as “handled again,” so the package cannot replace idempotency design. RabbitEvents 9.x compatibility gaps can create a false sense of safety if some publishers remain on 9.x. The per-queue ID semantics are correct but must be understood by product and operations teams.

Key questions:

  • What cache key TTL/retention is used, and how does that align with RabbitMQ redelivery windows and business idempotency requirements?
  • Are cache reads/writes atomic enough to prevent races across concurrent workers?
  • Which Laravel and PHP versions are supported, and are there constraints beyond rabbitevents/listener ^10.0?
  • How much cache memory/keyspace does the package consume per message, per queue, and under peak throughput?
  • Does the package emit metrics or logs beyond the warning for an unreachable store?
  • What happens with dead-letter queues, retries, and multiple listener classes on the same queue?
  • Can deduplication be enabled per queue or per listener, or is it global once installed?
  • How does the package behave during rolling deploys where some workers have the package and some do not?

Integration Approach

Stack fit: Strong fit for Laravel teams already running RabbitEvents 10.x and Redis, database, or memcached cache stores. Weak fit for organizations still publishing with RabbitEvents 9.x, teams using non-shared cache stores, or teams expecting exactly-once semantics without idempotent listeners. The no-plugin requirement is a meaningful adoption advantage because it avoids RabbitMQ cluster changes and plugin lifecycle management.

Migration path: Treat this as an incremental reliability enhancement rather than a platform migration. First inventory RabbitEvents publishers and listeners, confirm the listener version is ^10.0, and identify any 9.x publishers that would remain outside deduplication coverage. Provision or select a shared cache store, validate capacity and retention, and install the package in staging. Exercise the two critical scenarios explicitly: lost acknowledgement after all listeners succeed, and worker death during listener execution. Then enable on a low-risk queue before expanding.

Compatibility: Confirm PHP/Laravel support, cache-store support, and rabbitevents/listener ^10.0 constraints. Ensure all workers for a given queue use the same cache store and the same RABBITEVENTS_DEDUPLICATION_STORE value. Confirm that the chosen cache store is not local to a worker and has sufficient durability/availability for production. Confirm RabbitEvents 9.x messages are either absent or accepted as non-deduplicated. Confirm that existing retry, dead-letter, and listener side-effect behavior remains unchanged.

Sequencing:

  1. Inventory queues, listeners, publishers, and message ID availability.
  2. Upgrade or confirm RabbitEvents listener ^10.0 and eliminate 9.x publishers where deduplication is expected.
  3. Select and size the shared cache store; define TTL and eviction policy.
  4. Install the package in staging and configure RABBITEVENTS_DEDUPLICATION_STORE.
  5. Test lost-ack, worker-kill, cache-unavailable, and cache-eviction scenarios.
  6. Enable for one canary queue and monitor duplicate handling, cache health, and warning logs.
  7. Expand queue by queue with a rollback plan that includes removing the package or unsetting the store.
  8. Update listener idempotency standards so deduplication is treated as defense in depth, not a correctness guarantee.

Operational Impact

Maintenance: Low package surface area, but new operational dependencies: the shared cache store, environment configuration consistency, and cache key lifecycle. The package must track rabbitevents/listener major versions. The team must own cache retention and eviction policies because they directly affect duplicate behavior. Missing cache configuration stops workers at start, which is good for catching errors but can turn a config mistake into a deployment outage.

Support: Support and on-call teams need a runbook for the “store unreachable” warning. That condition does not drop or block messages, but it silently disables deduplication, so it is a duplicate-risk event rather than an outage. Dashboards should cover cache availability, cache latency, key volume, eviction rate, and warnings from the package. Application owners must confirm that listener side effects are idempotent; support should not assume this package guarantees single execution.

Scaling: Deduplication adds cache lookups/writes per message and stores keys per queue. Scaling worker count increases cache traffic and key cardinality, so the cache store must be sized for peak message throughput and retention. Redis is likely the simplest fit, but database and memcached have different latency, persistence, and eviction characteristics. Multi-region or multi-cluster deployments need special attention because all workers for a queue must share the same store. Benchmark before broad rollout.

Failure modes: A missing cache store config prevents worker start, which is fail-fast and visible. An unreachable cache store allows messages to be processed without deduplication and logs a warning, so duplicates are possible. Cache eviction or expiry can cause duplicate processing. Worker death during listener execution means the message is handled again by design. Lost acknowledgement after successful listener execution is the primary duplicate case the package skips. RabbitEvents 9.x messages are not deduplicated. No RabbitMQ plugin dependency reduces broker-side failure modes.

Ramp-up: Developer ramp-up is low, but operational ramp-up is moderate. Teams need to understand at-least-once delivery, per-queue deduplication scope, cache-store requirements, and the difference between “deduplicated” and “idempotent.” A TPM should require staging evidence for lost-ack and worker-kill scenarios, a cache-outage runbook, and an idempotency review before production expansion. Rollout should be canary-first, with clear success criteria: no unexpected duplicate side effects, stable cache latency, bounded key growth, and actionable warning alerts.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource