2017 © Pedro Peláez
 

library amqp

This library is a PHP implementation of the AMQP protocol.

image

zircote/amqp

This library is a PHP implementation of the AMQP protocol.

  • Monday, May 20, 2013
  • by zircote
  • Repository
  • 1 Watchers
  • 2 Stars
  • 18,314 Installations
  • PHP
  • 3 Dependents
  • 3 Suggesters
  • 4 Forks
  • 1 Open issues
  • 7 Versions
  • 2 % Grown

The README.md

AMQP

Build Status, (*1)

Setup

git, (*2)

`git clone git://github.com/zircote/AMQP.git`

composer, (*3)

{
  "require": [
    "zircote/amqp": "master-dev"
  ]
}

composer install, (*4)

Usage

host is defined by passing a URN string as first connection parameter:, (*5)

`amqp://user:pass@hostname:port/vhost`
`amqps://user:pass@hostname:port/vhost`

connection options are passed as the second parameter of the connection:, (*6)

 false,
    'login_method' => \AMQP\Connection::AMQP_AUTH_PLAIN,
    'login_response' => null,
    'locale' => 'en_US',
    'connection_timeout' => 3,
    'read_write_timeout' => 3,
    'context' => null,
    'ssl_options' => array()
);
$connection = new \AMQP\Connection($amqp, $options);

```

With RabbitMQ running open two Terminals and on the first one execute the following commands to start the consumer:

    $ cd php-amqplib/demo
    $ php amqp_consumer.php

Then on the other Terminal do:

    $ cd php-amqplib/demo
    $ php amqp_publisher.php some text to publish

You should see the message arriving to the process on the other Terminal

Then to stop the consumer, send to it the `quit` message:

    $ php amqp_publisher.php quit

If you need to listen to the sockets used to connect to RabbitMQ then see the example in the non blocking consumer.

    $ php amqp_consumer_non_blocking.php

## More Examples ##

- `amqp_ha_consumer.php`: demoes the use of mirrored queues
- `amqp_consumer_exclusive.php` and `amqp_publisher_exclusive.php`: demoes fanout exchanges using exclusive queues.
- `amqp_consumer_fanout_{1,2}.php` and `amqp_publisher_fanout.php`: demoes fanout exchanges with named queues.
- `basic_get.php`: demoes obtaining messages from the queues by using the _basic get_ AMQP call.

## Loading Classes ##

    $ ant setup
Place the following in your bootstrap once composer has been installed in the project:

```php

Benchmarks

To run the publishing/consume benchmark type:, (*7)

$ ant benchmark

Tests

Once your environment is set up you can run your tests like this:, (*8)

$ ant build

History

This project is a work in progress and derived from work begun by php-amqplib. It attempts to achieve a cleaner, more friendly use-case by updating the API, documentation and php 5.3 compatibility. Because there was no desire to perform these changes in the related projects due to outdating books and publication, it was my deciscion to fork and begin this work., (*9)

For more information on its history please see this project., (*10)

The Versions

20/05 2013

dev-master

9999999-dev https://github.com/zircote/AMQP

This library is a PHP implementation of the AMQP protocol.

  Sources   Download

LGPL-2.1

The Requires

  • php >=5.3.0

 

rabbitmq queue message amqp

20/05 2013

dev-bugfix/connection-timeout-fix

dev-bugfix/connection-timeout-fix https://github.com/zircote/AMQP

This library is a PHP implementation of the AMQP protocol.

  Sources   Download

LGPL-2.1

The Requires

  • php >=5.3.0

 

rabbitmq queue message amqp

20/05 2013

1.0.3

1.0.3.0 https://github.com/zircote/AMQP

This library is a PHP implementation of the AMQP protocol.

  Sources   Download

LGPL-2.1

The Requires

  • php >=5.3.0

 

rabbitmq queue message amqp

01/04 2013

1.0.2

1.0.2.0 https://github.com/zircote/AMQP

This library is a PHP implementation of the AMQP protocol.

  Sources   Download

LGPL-2.1

The Requires

  • php >=5.3.0

 

rabbitmq queue message amqp

01/04 2013

1.0.1

1.0.1.0 https://github.com/zircote/AMQP

This library is a PHP implementation of the AMQP protocol.

  Sources   Download

LGPL-2.1

The Requires

  • php >=5.3.0

 

rabbitmq queue message amqp

05/11 2012

1.0.0

1.0.0.0 https://github.com/zircote/AMQP

This library is a PHP implementation of the AMQP protocol.

  Sources   Download

LGPL-2.1

The Requires

  • php >=5.3.0

 

rabbitmq queue message amqp

04/11 2012

0.6.0

0.6.0.0 https://github.com/zircote/AMQP

This library is a PHP implementation of the AMQP protocol.

  Sources   Download

LGPL-2.1

The Requires

  • php >=5.3.0

 

rabbitmq queue message amqp