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

qpid::messaging.Message::setTTL() unit ambiguity can cause unexpectected behavior

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.6
    • C++ Broker, C++ Client
    • None

    Description

      qpid::messaging.Message::setTTL( boost::uint64_t ttl ) - does not declare its units.

      The currently exposed time types are AbsTime and Duration, which seems to imply they should be used for encapsulating time.

      When a Duration object is passed to setTTL, the inline operator int64_t() returns the member variable nanoseconds.

      When this value is propagated to the broker, it is interpreted around /cpp/src/qpid/broker/Message # 353 to be in millisecond units.

      I would recommend:

      • document Message.setTTL units clearly - pick ms or ns
      • if ms, then overload setTTL to take a Duration object so we can use without error by converting in setTTL
      • if ns, then somewhere downstream (OutgoingMessage#351 ?) the ns needs to get converted to ms

      Attachments

        Issue Links

          Activity

            People

              gsim Gordon Sim
              kbonin Kerry Bonin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: