php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59964 AMQPQueue::get() not able to parse zip compressed messages
Submitted: 2011-09-21 08:49 UTC Modified: 2012-02-28 21:12 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: stoyan at frantzov dot com Assigned: pdezwart (profile)
Status: Closed Package: amqp (PECL)
PHP Version: PHP 5.3.2 OS: Ubuntu
Private report: No CVE-ID: None
 [2011-09-21 08:49 UTC] 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
                                        @
                                         ��

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-21 10:28 UTC] stoyan at frantzov dot com
I've wrongly type php version. It is 5.3.2 not 5.2.10
 [2011-10-26 02:17 UTC] pdezwart@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: pdezwart
 [2012-02-28 21:12 UTC] pdezwart@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php


 [2012-02-28 21:12 UTC] pdezwart@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Apr 16 02:01:23 2021 UTC