PHPackages                             ayman-mahgoub/chinchilla - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. ayman-mahgoub/chinchilla

ActiveLibrary[HTTP &amp; Networking](/categories/http)

ayman-mahgoub/chinchilla
========================

Chinchilla is Php-amqplib library wrapper and AMQP tool

00PHPCI failing

Since Feb 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/aymanMahgoub/chinchilla)[ Packagist](https://packagist.org/packages/ayman-mahgoub/chinchilla)[ RSS](/packages/ayman-mahgoub-chinchilla/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

chinchilla
==========

[](#chinchilla)

- Chinchilla is Php-amqplib library wrapper and AMQP tool for native php applications.

About
-----

[](#about)

- We build **Chinchilla** to suitable native php apps that need messaging using Php-amqplib in easier way.

Installing
----------

[](#installing)

- Via Composer

```
$ composer require ayman-mahgoub/chinchilla

```

Getting Started
---------------

[](#getting-started)

- First create config.php file in your project Directory you have to declare this constants

```
define("AMQP_HOST", "localhost");
define("AMQP_PORT", 5670);
define("AMQP_USERNAME", "rabbitmq");
define("AMQP_PASSWORD", "rabbitmq");
define("AMQP_VHOST", "/");
define("AMQP_LOGIN_METHOD", 'AMQPLAIN');
define("AMQP_LOCAL", 'en_US');
define("AMQP_CONNECTION_TIMEOUT", 120);
define("AMQP_READ_WRITE_TIMEOUT", 120);
define("AMQP_KEEP_ALIVE", true);
define("AMQP_HEART_BEAT", 60);
define("AMQP_CONTEXT", true);
define("AMQP_CHANNEL_RPC_TIMEOUT", 0.0);
define("AMQP_SSL_PROTOCOL", 0.0);
define("AMQP_INSIST", false);
define("AMQP_LOGIN_RESPONSE", null);
define("AMQP_QUEUES", "queues.json"); // full path for your .json queues file.

```

- create your queues.json file (you can name it what ever you want for now we will assume that you name it as queue.json).
- this is the structure for your queues.json

```
{
   "consumers":{
      "first_queue_name":{
         "connection":"socket",
         "consumer":"FullPathCallBackClass"
      },
        "second_queue_name":{
         "connection":"socket",
         "consumer":"FullPathCallBackClass"
      }
   },
   "producers":{
      "first_queue_name":{
         "connection":"socket",
         "properties":{
            "type":"direct",
            "delivery_mode":2
         }
      }
   }
}

```

- example

```
{
   "consumers":{
      "upload_picture":{
         "connection":"socket",
         "callback":"Chinchilla\Consumer\Services\ConsumerAny"
      }
   },
   "producers":{
      "upload_picture":{
         "connection":"socket",
         "properties":{
            "type":"direct",
            "delivery_mode":2
         }
      }
   }
}

```

- now you are ready to use chinchilla ;).
- use QueuePublisher to publish any message you want to any queue by passing message and routing\_key
- example

```
    $queuePublisher = new QueuePublisher();
    $queuePublisher->publish("my first message", "upload_picture");

```

- use ConsumeQueueMessageService to consume any number of messages form any queue you need by queue name and number of message.
- example

```
    $consumeQueueMessageService = new ConsumeQueueMessageService();
    $consumeQueueMessageService->consumeMessageFormQueue("upload_picture", 5);

```

- use QueueDeletionService to delete any queue you want by passing queue name only.
- example

```
    $queueDeletionService = new QueueDeletionService();
    $queueDeletionService->partialDeleteQueue("upload_picture");
    // partialDeleteQueue will delete queue form AMQP broker only

    $queueDeletionService = new QueueDeletionService();
    $queueDeletionService->fullDeleteQueue("upload_picture");
    // fullDeleteQueue method will delete queue form AMQP broker and from queues.json too.

```

Running the tests
-----------------

[](#running-the-tests)

`$ composer test`

**please note that**
====================

[](#please-note-that)

- We are well know that this library is not perfect yet, so we are welcoming any contribution.
- For now routing\_key must be equal to queue name.
- For now we only support socket connection more connections type will implemented in the future we will keep the readme updated.
- For now tests are test connections only we will add more tests in the future too.

Contributing
------------

[](#contributing)

- Please read [CONTRIBUTING.md](https://github.com/aymanMahgoub/chinchilla/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

Authors
-------

[](#authors)

- **Ayman Mahgoub** - *Initial work* - [aymanMahgoub](https://github.com/aymanMahgoub)
- See also the list of [contributors](https://github.com/aymanMahgoub/chinchilla/contributors) who participated in this project.

License
-------

[](#license)

- This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/aymanMahgoub/chinchilla/blob/master/LICENSE.md) file for details

Acknowledgments
---------------

[](#acknowledgments)

- Inspiration form [Thumper](https://github.com/php-amqplib/Thumper) and [RabbitMqBundle](https://github.com/php-amqplib/RabbitMqBundle).
- Helped a lot to write this README.md [A template to make good README.md](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2).

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/10bccf58018f13672791a7153df22472e91a5f1012ff726048142e129612fba7?d=identicon)[AymanMahgoub](/maintainers/AymanMahgoub)

---

Top Contributors

[![aymanMahgoub](https://avatars.githubusercontent.com/u/22292358?v=4)](https://github.com/aymanMahgoub "aymanMahgoub (23 commits)")

### Embed Badge

![Health badge](/badges/ayman-mahgoub-chinchilla/health.svg)

```
[![Health](https://phpackages.com/badges/ayman-mahgoub-chinchilla/health.svg)](https://phpackages.com/packages/ayman-mahgoub-chinchilla)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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