{"id":18498429,"url":"https://github.com/zircote/amqp","last_synced_at":"2025-04-09T00:31:20.171Z","repository":{"id":3964084,"uuid":"5058092","full_name":"zircote/AMQP","owner":"zircote","description":"AMQP -- This is experimental only and not intended for production use at this time, If this is a concern, look elsewhere.","archived":false,"fork":false,"pushed_at":"2013-05-20T19:46:28.000Z","size":5336,"stargazers_count":2,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T19:45:04.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zircote.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-15T17:06:24.000Z","updated_at":"2016-11-01T07:59:49.000Z","dependencies_parsed_at":"2022-09-17T06:00:18.189Z","dependency_job_id":null,"html_url":"https://github.com/zircote/AMQP","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2FAMQP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2FAMQP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2FAMQP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2FAMQP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zircote","download_url":"https://codeload.github.com/zircote/AMQP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247949872,"owners_count":21023406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T13:39:50.817Z","updated_at":"2025-04-09T00:31:15.161Z","avatar_url":"https://github.com/zircote.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AMQP #\n\n\n[![Build Status](https://secure.travis-ci.org/zircote/AMQP.png)](http://travis-ci.org/zircote/AMQP)\n\nSetup\n=============\n__git__\n\n    `git clone git://github.com/zircote/AMQP.git`\n\n__composer__\n\n```json\n{\n  \"require\": [\n    \"zircote/amqp\": \"master-dev\"\n  ]\n}\n```\n\n`composer install`\n\n\nUsage\n======\n\nhost is defined by passing a URN string as first connection parameter:\n\n    `amqp://user:pass@hostname:port/vhost`\n    `amqps://user:pass@hostname:port/vhost`\n\nconnection options are passed as the second parameter of the connection:\n\n```php\n\u003c?php\n\n$amqp = 'amqp://user:pass@hostname:port/vhost';\n\n// Options Options Array\n$options = array(\n    'insist' =\u003e false,\n    'login_method' =\u003e \\AMQP\\Connection::AMQP_AUTH_PLAIN,\n    'login_response' =\u003e null,\n    'locale' =\u003e 'en_US',\n    'connection_timeout' =\u003e 3,\n    'read_write_timeout' =\u003e 3,\n    'context' =\u003e null,\n    'ssl_options' =\u003e array()\n);\n$connection = new \\AMQP\\Connection($amqp, $options);\n\n```\n\nWith RabbitMQ running open two Terminals and on the first one execute the following commands to start the consumer:\n\n    $ cd php-amqplib/demo\n    $ php amqp_consumer.php\n\nThen on the other Terminal do:\n\n    $ cd php-amqplib/demo\n    $ php amqp_publisher.php some text to publish\n\nYou should see the message arriving to the process on the other Terminal\n\nThen to stop the consumer, send to it the `quit` message:\n\n    $ php amqp_publisher.php quit\n\nIf you need to listen to the sockets used to connect to RabbitMQ then see the example in the non blocking consumer.\n\n    $ php amqp_consumer_non_blocking.php\n\n## More Examples ##\n\n- `amqp_ha_consumer.php`: demoes the use of mirrored queues\n- `amqp_consumer_exclusive.php` and `amqp_publisher_exclusive.php`: demoes fanout exchanges using exclusive queues.\n- `amqp_consumer_fanout_{1,2}.php` and `amqp_publisher_fanout.php`: demoes fanout exchanges with named queues.\n- `basic_get.php`: demoes obtaining messages from the queues by using the _basic get_ AMQP call.\n\n## Loading Classes ##\n\n    $ ant setup\nPlace the following in your bootstrap once composer has been installed in the project:\n\n```php\n\u003c?php\n\nrequire_once(dirname(__DIR__) . '/vendor/autoload.php');\n\n```\n\n## Debugging ##\n\nIf you want to know what's going on at a protocol level then add the following constant to your code:\n\n```php\n\u003c?php\ndefine('AMQP_DEBUG', true);\n\n... more code\n\n?\u003e\n```\n\n## Benchmarks ##\n\nTo run the publishing/consume benchmark type:\n\n    $ ant benchmark\n\n## Tests ##\n\nOnce your environment is set up you can run your tests like this:\n\n    $ ant build\n\n\nHistory\n============\n\nThis project is a work in progress and derived from work begun by [php-amqplib](https://github.com/tnc/php-amqplib).\nIt attempts to achieve a cleaner, more friendly use-case by updating the API, documentation and php 5.3 compatibility.\nBecause there was no desire to perform these changes in the related projects due to outdating books and publication, it\nwas my deciscion to fork and begin this work.\n\nFor more information on its history please see this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzircote%2Famqp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzircote%2Famqp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzircote%2Famqp/lists"}