Bug #59964 [Opn->Asn]: AMQPQueue::get() not able to parse zip compressed messages
| From: | pdezwart@php.net | Date: | Wed, 26 Oct 2011 02:17:40 +0000 |
| Subject: | Bug #59964 [Opn->Asn]: AMQPQueue::get() not able to parse zip compressed messages | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-164573@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=59964&edit=1
ID: 59964
Updated by: pdezwart@php.net
Reported by: stoyan at frantzov dot com
Summary: AMQPQueue::get() not able to parse zip compressed
messages
-Status: Open
+Status: Assigned
Type: Bug
Package: amqp
Operating System: Ubuntu
PHP Version: PHP 5.3.2
-Assigned To:
+Assigned To: pdezwart
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2011-09-21 10:28:25] stoyan at frantzov dot com
I've wrongly type php version. It is 5.3.2 not 5.2.10
------------------------------------------------------------------------
[2011-09-21 08:49:58] stoyan at frantzov dot com
Description:
------------
I publish zip compressed messages in queue. If i take messages with AMQPQueue::get() for example
with:
$msg = $q->get();
in $msg['msg'] i do not receive correct compressed value but some broken binary.
print_r($msg) has this output:
Array (
[routing_key] => platform.mt.status.bond.a9bd43e4f4445679e1677898f26f35f67
[exchange] =>
[delivery_tag] => 1
[Content-type] => application/json
[Content-encoding] => gz
[priority] => 0
[count] => 0
[msg] => (
8
5.f��d
@
�count5�
��(
8
5.f��d
@
��
)
AMQPQueue::consume() do not have this problem
Reproduce code:
---------------
$cnn = new AMQPConnection(
array(
'host' => '192.168.1.226',
'vhost' => $vhost,
'port' => 5672,
'login' => $user,
'password' => $pass
)
);
$cnn->connect();
$q = new AMQPQueue($cnn);
$q->declare('platform.mt.status.bond.a9bd43e4f4445679e1677898f26f35f67',
AMQP_DURABLE);
$msg = $q->get();
if ($msg['count']>-1)
{
print_r($msg);
}
Expected result:
----------------
in msg['msg'] after decompresion i expect to see:
[{"principal":"bond","guid":"cc0c7a91-b727-4aa9-9947-df6b0064e0d2","msisdn":393411223344,"operator":"H3G","ts":1316536817934}]
Actual result:
--------------
in $msg['msg'] before decompression i see and this is invalid compressed binary
8
5.f��d
@
�count5�
��(
8
5.f��d
@
��
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=59964&edit=1