Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F622521
bug_gh53-2.phpt
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
bug_gh53-2.phpt
View Options
--TEST--
Upgrade to RabbitMQ 3.1.0-1: AMQPConnectionException: connection closed unexpectedly (2)
--SKIPIF--
<?php
if (!extension_loaded("amqp")) print "skip AMQP extension is not loaded";
elseif (!getenv("PHP_AMQP_HOST")) print "skip PHP_AMQP_HOST environment variable is not set";
?>
--FILE--
<?php
$cnn = new AMQPConnection();
$cnn->setHost(getenv('PHP_AMQP_HOST'));
$cnn->connect();
$channel = new AMQPChannel($cnn);
$exchange = new AMQPExchange($channel);
$exchange->setName('exchange' . bin2hex(random_bytes(32)));
$exchange->setType(AMQP_EX_TYPE_TOPIC);
$exchange->declareExchange();
$queue = new AMQPQueue($channel);
$queue->setName('queue1' . bin2hex(random_bytes(32)));
$queue->declareQueue();
$queue->bind($exchange->getName(), '#');
$exchange->publish('body1', 'routing.1');
$exchange->publish('body2', 'routing.1');
$msg = $queue->get(AMQP_AUTOACK);
var_dump($msg->getBody());
$msg = $queue->get(AMQP_AUTOACK);
var_dump($msg->getBody());
?>
==DONE==
--EXPECT--
string(5) "body1"
string(5) "body2"
==DONE==
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 14, 8:16 PM (23 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
151970
Default Alt Text
bug_gh53-2.phpt (1 KB)
Attached To
Mode
R113 php-ampqp
Attached
Detach File
Event Timeline