Add support for timestamp, decimal and table field values

Bug #358251 reported by Thomas Herve
2
Affects Status Importance Assigned to Milestone
txAMQP
Fix Released
Undecided
Unassigned

Bug Description

The codec and spec files copied from qpid are fairly outdate: in particular, latest version manages new serialization fields supported by the 0.8 version. It would be nice to synchronize those files.

Revision history for this message
Esteve Fernandez (esteve) wrote :

txAMQP is based off Qpid M2, since M3 added a bunch of stuff that we didn't need (Futures, support for 0-10, etc.), so I haven't tracked it since then. The codec and spec APIs changed a bit, and it might not be trivial to copy them straight away, so what fields are missing in txAMQP? I'll try to port them without changing the API

Thanks!

Revision history for this message
Thomas Herve (therve) wrote :

I didn't track the changes precisely, but for example it handles now timestamp and table unserialization (if you put them in headers).

I think it's fairly simple to port them: it's just using a new mllib package for xml stuff, everything else looks mostly the same.

Thanks for your quick answer!

Revision history for this message
Esteve Fernandez (esteve) wrote :

Could you test the linked branch? It adds support for timestamps.

As for arbitrary headers, I think txAMQP already supported them, I tested adding a dict to a "headers" field in a content and it worked. Could you give an example of a table field that doesn't work with txAMQP?

Thanks!

Revision history for this message
Thomas Herve (therve) wrote :

Yes, I have an example, creating a message using amqplib:

    msg = amqp.Message(msg_body, content_type='text/plain',
       application_headers={'foo': 7, 'bar': {'baz': 1}})

I got the following traceback in txamqp:

   File "src/txamqp/protocol.py", line 153, in _unpackFrame
   File "src/txamqp/connection.py", line 183, in decode
   File "src/txamqp/codec.py", line 86, in decode
   File "src/txamqp/codec.py", line 184, in decode_table
           exceptions.ValueError: 'F'

The problem is that decode_table doesn't recurse (it can't decode a table contained inside a table).

Revision history for this message
Thomas Herve (therve) wrote :

So apparently even the latest version doesn't support it... It still only supports strings and integers in tables (the spec explicitly mentions timestamp, decimal and table as field values). It may not be a killer feature I guess.

Revision history for this message
Esteve Fernandez (esteve) wrote :

Thomas, what field values does txAMQP lack support for? I'd like to change the report title to reflect that and concentrate on adding support for them. The value types that need to be implemented are, AFAIK:

- timestamp
- decimal
- table
- recursive table

Is that right? Is there any other value type?

summary: - Sync with latest python-qpid version
+ Add support for timestamp, decimal and table field values
Changed in txamqp:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.