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
Php Amqp Client

Php Amqp Client Laravel Package

sigbits/php-amqp-client

A PHP AMQP client for connecting to RabbitMQ and other AMQP brokers. It supports core messaging workflows such as publishing and consuming messages, giving PHP applications a lightweight way to add queue-based communication.

Deep Wiki
Context7

sigbits/php-amqp-client is a lightweight PHP client for AMQP message brokers, giving you a clean, object-oriented API for publishing and consuming messages over RabbitMQ and other AMQP-compatible servers. It wraps connection handling, channels, exchanges, and queues behind predictable abstractions so you can focus on your messaging logic instead of protocol details.

  • Simple connections with configurable host, port, credentials, and vhost
  • Publish/consume helpers for exchanges, queues, and routing keys
  • Flexible message handling via callbacks and manual acknowledgements
  • Exception-based error reporting for failed connections and operations
  • PSR-friendly design that fits naturally into existing PHP applications
Frequently asked questions about Php Amqp Client
Does sigbits/php-amqp-client work with Laravel?
Yes, it is a framework-agnostic PHP AMQP client, so it can be used inside Laravel applications without framework lock-in. You can configure the connection through Laravel configuration or environment variables and resolve the client from a service provider if desired. Because it does not impose a Laravel-specific integration, you control how it is wired into your app.
How do I install sigbits/php-amqp-client with Composer?
Install it with Composer using composer require sigbits/php-amqp-client. After installation, include Composer's autoloader and create a connection using your RabbitMQ credentials. Check the package's composer.json for the exact PHP version and extension requirements before deploying.
How do I connect to RabbitMQ using sigbits/php-amqp-client?
Use the client's connection API with your RabbitMQ host, port, username, password, and virtual host. Keep these values in environment variables rather than hard-coding them in your application. Open a channel from the connection for publishing or consuming, and close resources cleanly when your script finishes.
How do I publish a message to RabbitMQ with this PHP AMQP client?
Create a connection and channel, declare or target an exchange, then publish your message payload with the appropriate routing key. Serialize structured data such as arrays to JSON before publishing if that is your consumer contract. Set message properties like content type and delivery mode according to your reliability needs.
How do I consume messages from a RabbitMQ queue in PHP?
Open a connection and channel, declare the queue and any bindings, then run the client's consume loop with a callback that processes each delivery. Acknowledge messages only after successful processing, and reject or requeue them when handling fails. Include a shutdown check so long-running consumers can exit gracefully.
Can I declare exchanges, queues, and bindings with sigbits/php-amqp-client?
Yes, the package overview lists exchanges, queues, publishing, and consuming as supported operations. You can use those APIs to declare topology and bind queues to exchanges with routing keys. Declarations should match your existing RabbitMQ topology to avoid configuration conflicts.
Is sigbits/php-amqp-client a lightweight alternative to php-amqplib?
The package is described as a lightweight AMQP 0-9-1 client with a simple API and no heavy dependencies or framework lock-in. php-amqplib is a more established general-purpose option, so compare API surface, dependency requirements, and feature coverage for your use case. For straightforward publish and consume workflows in PHP or Laravel, this client may be sufficient.
What dependencies or PHP extensions does sigbits/php-amqp-client require?
The package is positioned as a lightweight client without heavy dependencies, but the exact PHP version and extension requirements are defined in its composer.json. Review those requirements before installing it in Laravel or any production PHP environment. This helps confirm compatibility with your runtime and deployment setup.
How should I handle reconnects and failures in production with this AMQP client?
Wrap connection and channel usage in retry logic with backoff, and recreate channels after connection failures. Use durable queues and persistent messages where appropriate, acknowledge deliveries only after successful processing, and make consumers idempotent. Verify which reliability features the client exposes before relying on publisher confirms or advanced recovery behavior.
Is sigbits/php-amqp-client maintained and suitable for production use?
It is a lightweight AMQP 0-9-1 client suitable for applications that need direct RabbitMQ publishing and consuming without framework lock-in. Before using it in production, check its release history, issue activity, and Composer metadata to assess maintenance. Also test connection recovery, acknowledgements, and queue topology in a staging environment that mirrors production.
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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core