2017 © Pedro Peláez
 

library messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

image

dosomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  • Friday, December 9, 2016
  • by DeeZone
  • Repository
  • 5 Watchers
  • 4 Stars
  • 1,842 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 5 Open issues
  • 32 Versions
  • 0 % Grown

The README.md

messagebroker-phplib

A PHP baed library that ascts as a wrapper around the php-amqplib/php-amqplib AMQP PHP library. The goal is to provide utility methods to simplify some of the more common activities of interacting with a AMQP based (RabbitMQ) server., (*1)

Usage

Within the composer.json file of any PHP based application include this package with: "require": { "php": ">= 5.3.0", "DoSomething/messagebroker-phplib": "0.3.*", ..., (*2)

Create an instance of the class

// RabbitMQ
$rabbitCredentials = [
    'host' =>  getenv("RABBITMQ_HOST"),
    'port' => getenv("RABBITMQ_PORT"),
    'username' => getenv("RABBITMQ_USERNAME"),
    'password' => getenv("RABBITMQ_PASSWORD"),
    'vhost' => getenv("RABBITMQ_VHOST"),
];

$config['exchange'] = array(
  'name' => $exchangeSettings->name,
  'type' => $exchangeSettings->type,
  'passive' => $exchangeSettings->passive,
  'durable' => $exchangeSettings->durable,
  'auto_delete' => $exchangeSettings->auto_delete,
);

$config['queue'] = array(
  'name' => $queueSetting->name,
  'passive' => $queueSetting->passive,
  'durable' =>  $queueSetting->durable,
  'exclusive' =>  $queueSetting->exclusive,
  'auto_delete' =>  $queueSetting->auto_delete,
  'routingKey' =>  $queueSetting->routing_key,
  'bindingKey' => $bindingKey,
);

$mb = new MessageBroker($rabbitCredentials, $config));

Publish a message

$this->messageBroker->publish($message, <routing key>);

Consume a message

How a message will be consumed is defined in the connection to the queue., (*3)

$config['consume'] = array(
  'no_local' => $queueSetting->consume->no_local,
  'no_ack' => $queueSetting->consume->no_ack,
  'nowait' => $queueSetting->consume->nowait,
  'exclusive' => $queueSetting->consume->exclusive,
);

The number of messages for the consumer to reserve with each callback. This is Necessary for parallel processing when more than one consumer is running on the same queue., (*4)

define('QOS_SIZE', 1);

$mb->consumeMessage([new consumer class(), <consumer method], QOS_SIZE);

where the consumed message details will be sent to consumer method>, (*5)

 public function <consumer method>($payload) {

Gulp Support

Use a path directly to gulp ./node_modules/.bin/gulp or add an alias to your system config (.bash_profile) as alias gulp='./node_modules/.bin/gulp', (*6)

Linting

  • gulp lint

See gulpfile.js for configuration and combinations of tasks., (*7)

PHP CodeSniffer

  • php ./vendor/bin/phpcs --standard=./ruleset.xml --colors -s MessageBroker-Drupal.php src tests Listing of all coding volations by file., (*8)

  • php ./vendor/bin/phpcbf --standard=./ruleset.xml --colors MessageBroker-Drupal.php src tests Automated processing of files to adjust to meeting coding standards., (*9)

Test Coverage

  • gulp test

or, (*10)

  • npm test

PHP Unit

  • $ ./vendor/bin/phpunit --verbose tests

The Versions

09/12 2016

dev-master

9999999-dev https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

09/12 2016

0.3.8

0.3.8.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

30/07 2016

0.3.7

0.3.7.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

29/07 2016

0.3.6

0.3.6.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

28/07 2016

0.3.2

0.3.2.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

28/07 2016

0.3.0

0.3.0.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

21/01 2016

0.2.9

0.2.9.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

21/01 2016

0.2.8

0.2.8.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

21/01 2016

dev-Issue35-Exchange_bind

dev-Issue35-Exchange_bind https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

09/09 2015

0.2.7

0.2.7.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

02/09 2015

0.2.6

0.2.6.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

29/07 2015

0.2.4

0.2.4.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

28/07 2015

0.2.3

0.2.3.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

30/05 2015

0.2.2

0.2.2.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

30/05 2015

0.2.1

0.2.1.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

08/05 2015

0.2.0

0.2.0.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

16/04 2015

0.1.19

0.1.19.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

07/04 2014

0.1.17

0.1.17.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

02/04 2014

0.1.16

0.1.16.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

26/03 2014

0.1.15

0.1.15.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

21/03 2014

0.1.14

0.1.14.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

18/03 2014

0.1.13

0.1.13.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

18/03 2014

0.1.12

0.1.12.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

13/03 2014

0.1.11

0.1.11.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

10/03 2014

0.1.10

0.1.10.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

06/03 2014

0.1.9

0.1.9.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

06/03 2014

0.1.8

0.1.8.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

03/03 2014

0.1.6

0.1.6.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

28/02 2014

0.1.5

0.1.5.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

19/02 2014

0.1.2

0.1.2.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

rabbitmq message broker php library

19/02 2014

0.1.1

0.1.1.0 https://github.com/DoSomething/messagebroker-phplib

A library of functionality shared between the components that make up the DoSomething.org Message Broker system.

  Sources   Download

MIT

The Requires

 

The Development Requires

message broker php library

10/02 2014

0.1.0

0.1.0.0 https://github.com/DoSomething/message-broker

A message broker system to cordinate sending messsages to DoSomething.org members.

  Sources   Download

MIT

The Requires

 

The Development Requires

message broker