Download the PHP package maksimdimitrov/mdim-amqp-laravel without Composer

On this page you can find all versions of the php package maksimdimitrov/mdim-amqp-laravel. 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 mdim-amqp-laravel

Laravel Service Provider for php-amqplib to use with RabbitMQ without Laravel queues.

It is developed for versions greater than Laravel 5.7

How to install

Option 1

Use

Option 2

Add to your composer.json file in "require" section:

and in "repositories" section:

Next:

Next step is to run to publish the config file in config/mdim_rabbitmq.php Check the available commands and with

The config in config/mdim_rabbitmq.php

You can have many connections: default, some-other-rabbitmq-service, etc...

How to use

You need to create a new job class which will act as consumer and hold the callback function when a message is received. The class has to extend and have function handle() implemented, which is the callback function. You can use the dependency container to inject services. You also need to define getConnectionName(), getQueueName() and getConsumerTag(), check AMQP docs for property descriptions https://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.consume getConnectionName() should return name of the connection from config/mdim_rabbitmq.php e.g. default or some-other-rabbitmq-service

All the static methods in you can rewrite for your consumer needs.

There are two examples ready to run. Check the job class which will consume messages after you start it. You can push messages with example command class

Start this example with a command in the console

Open another console and run a command

In the first console you should see the received message now.

After you write your job work class with example name you can start it with

Publishing messages can be done without commands, but also from your controller like this:

An example consumer class can be:


All versions of mdim-amqp-laravel with dependencies

PHP Build Version
Package Version
Requires php-amqplib/php-amqplib Version ^3.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 maksimdimitrov/mdim-amqp-laravel contains the following files

Loading the files please wait ....