Download the PHP package nuwber/rabbitevents without Composer

On this page you can find all versions of the php package nuwber/rabbitevents. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rabbitevents

RabbitEvents

Tests Status codecov Total Downloads Latest Version License

Let's imagine a use case: a User made a payment. You need to handle this payment, register the user, send him emails, send analytics data to your analysis system, and so on. The modern infrastructure requires you to create microservices that do their specific job and only it: one handles payments, one is for user management, one is the mailing system, one is for analysis. How to let all of them know that a payment succeeded and handle this message? The answer is "To use RabbitEvents".

Once again, the RabbitEvents library helps you publish an event and handle it in another app. It doesn't make sense to use it in the same app because Laravel's Events work better for that.

Demo

rabbit-events-demo

Table of Contents

  1. Installation via Composer
    • Configuration
  2. Upgrade from 7.x to 8.x
  3. Publisher component
  4. Listener component
  5. Examples
  6. Non-standard use

Installation via Composer

You can use Composer to install RabbitEvents into your Laravel project:

Configuration

After installing RabbitEvents, publish its config and a service provider using the rabbitevents:install Artisan command:

This command installs the config file at config/rabbitevents.php and the Service Provider file at app/providers/RabbitEventsServiceProvider.php.

The config file is very similar to the queue connection, but with the separate config, you'll never be confused if you have another connection to RabbitMQ.

Upgrade from 7.x to 8.x

PHP 8.1 required

RabbitEvents now requires PHP 8.1 or greater.

Supported Laravel versions

RabbitEvents now supports Laravel 9.0 or greater.

Removed --connection option from the rabbitevents:listen command

There's an issue #98 that still needs to be resolved. The default connection is always used instead.

RabbitEvents Publisher

The RabbitEvents Publisher component provides an API to publish events across the application structure. More information about how it works can be found on the RabbitEvents Publisher page.

RabbitEvents Listener

The RabbitEvents Listener component provides an API to handle events that were published across the application structure. More information about how it works can be found on the RabbitEvents Listener page.

Non-standard use

If you're using only one part of RabbitEvents, you should know a few things:

  1. You remember, we're using RabbitMQ as the transport layer. In the RabbitMQ Documentation, you can find examples of how to publish your messages using a routing key. This routing key is the event name, like something.happened from the examples above.

  2. RabbitEvents expects that a message body is a JSON-encoded array. Every element of an array will be passed to a Listener as a separate variable. For example:

There are 3 elements in this array, so 3 variables will be passed to a Listener (an array, a string, and an integer). If an associative array is being passed, the Dispatcher wraps this array by itself.


All versions of rabbitevents with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
enqueue/amqp-lib Version ^0.10
illuminate/support Version ^9.0|^10.0
illuminate/events Version ^9.0|^10.0
illuminate/console Version ^9.0|^10.0
illuminate/container Version ^9.0|^10.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nuwber/rabbitevents contains the following files

Loading the files please wait ....