Weave Code
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
Messenger Heartbeat Bundle

Messenger Heartbeat Bundle Laravel Package

answear/messenger-heartbeat-bundle

Symfony bundle that adds heartbeat/keepalive support to Messenger workers. Install via Composer and run messenger:consume or messenger:failed:retry with --keepalive to keep long-running workers alive and responsive.

View on GitHub
Deep Wiki
Context7

AMQP Transport for symfony messenger with heartbeat

Frequently asked questions about Messenger Heartbeat Bundle
How do I install the Messenger Heartbeat Bundle for Laravel/Symfony?
Run `composer require answear/messenger-heartbeat-bundle`—Symfony Flex auto-registers the bundle in `config/bundles.php`. No manual configuration is needed beyond adding `--keepalive` to your worker commands.
Does this bundle work with Laravel’s Messenger component?
No, this bundle is designed for Symfony’s Messenger with AMQP transport. Laravel users must use a compatible Symfony-based setup or explore alternatives like `php-amqplib` extensions for heartbeat support.
What Laravel/Symfony versions are supported?
The bundle requires **Symfony 7.2+** and **PHP 8.4+**. If your project uses older versions, you’ll need to upgrade or seek alternatives, as earlier Symfony 6/7.x versions are unsupported.
How do I enable heartbeat for my Messenger workers?
Add `--keepalive` to your existing commands: `php bin/console messenger:consume --keepalive` or `php bin/console messenger:failed:retry --keepalive`. No other changes are required.
Will this bundle prevent message loss during idle timeouts?
Yes, the heartbeat mechanism sends periodic PNCTL signals to keep AMQP connections alive, reducing false timeouts and message loss. However, it won’t resolve broker-level failures (e.g., RabbitMQ crashes).
Does this work with RabbitMQ or other AMQP brokers?
It works with any AMQP broker supporting **PNCTL signals** (e.g., RabbitMQ). Ensure your broker’s `heartbeat` parameter is configured to match the bundle’s defaults (e.g., `5` seconds) for optimal reliability.
Can I use this with Docker/Kubernetes for multi-worker setups?
Yes, but test in staging first. PNCTL signals are global, so shared processes (e.g., in Docker) or other tools using signals may cause conflicts. Monitor for signal collisions in orchestrated environments.
How do I monitor heartbeat effectiveness in production?
Enable Symfony’s logging to track connection activity. For deeper observability, export logs to a centralized system (e.g., ELK, Datadog) or implement custom metrics for `connection.last_activity` timestamps.
Are there performance impacts from using heartbeat?
Minimal—heartbeats add ~5% CPU overhead for keepalive pings. Under high-throughput scenarios (e.g., 10K+ messages/sec), benchmark to ensure latency/throughput isn’t affected.
What alternatives exist if I can’t upgrade to Symfony 7.2+?
For older Symfony versions, consider custom solutions like **php-amqplib** extensions with manual heartbeat logic or third-party packages like `enqueue/amqp-ext`. Laravel users may need to integrate AMQP libraries directly.
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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor