Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-5696

perl qpid client's qpid::messaging::Message() does not handle properly floats (non-quoted) in message properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.26
    • 0.28
    • Perl Client
    • None

    Description

      perl qpid client's qpid::messaging::Message() does not handle properly non-quoted floats in message properties.

      Let's have following snippet:

      1. cat /tmp/a.pl
        use qpid;

      use Time::HiRes qw( time sleep );
      use Data::Dumper;

      1. get_time()
      2. get precise time since epoch as float [ ~ time.time()]
        sub get_time {
        return ( time() );
        }

      my $message = new qpid::messaging::Message();
      my $time = get_time();
      $message->set_property('ts-float', $time);
      $message->set_property('ts-int', 4);
      $message->set_property('ts-nint', -4);
      $message->set_property('ts-str', "4.556");

      print $time;
      print "\n";
      print $message->get_properties();
      print "\n";
      print Dumper($message->get_properties());
      print "\n";
      print $message->get_properties()->

      {"ts-float"}

      ;
      print "\n";

      exit

      When executed you can see ts-float' hash value is not carried properly.

      1. perl -W /tmp/a.pl
        1397412379.47217
        HASH(0x1c03720)
        $VAR1 = { 'ts-int' => 4, 'ts-str' => '4.556', 'ts-nint' => -4, 'ts-float' => '1397412352' }

        ;

      1397412352

      Float value is read back as int which is incorrect.

      Attachments

        Activity

          People

            mcpierce Darryl Pierce
            mcpierce Darryl Pierce
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: