summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-07-08 15:53:49 +0000
committerRafael H. Schloming <rhs@apache.org>2010-07-08 15:53:49 +0000
commit124fd2ea104c564c7f72d65d5a6ce697e88f7474 (patch)
treea722d75ab17c94e435a4be7a6ec7dabed13e48fa /python
parent0a7f2e44f41288e231b1008ce25ab5bf137251dd (diff)
downloadqpid-python-124fd2ea104c564c7f72d65d5a6ce697e88f7474.tar.gz
convert ttl from seconds to milliseconds
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@961824 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/qpid/messaging/driver.py8
-rw-r--r--python/qpid/messaging/message.py8
2 files changed, 14 insertions, 2 deletions
diff --git a/python/qpid/messaging/driver.py b/python/qpid/messaging/driver.py
index 2175715c77..a3c565f205 100644
--- a/python/qpid/messaging/driver.py
+++ b/python/qpid/messaging/driver.py
@@ -980,6 +980,7 @@ class Engine:
break
for snd in ssn.senders:
+ # XXX: should included snd.acked in this
if snd.synced >= snd.queued and sst.need_sync:
sst.write_cmd(ExecutionSync(), sync_noop)
@@ -1182,9 +1183,11 @@ class Engine:
if msg.priority is not None:
dp.priority = msg.priority
if msg.ttl is not None:
- dp.ttl = msg.ttl
+ dp.ttl = long(msg.ttl*1000)
enc, dec = get_codec(msg.content_type)
body = enc(msg.content)
+
+ # XXX: this is not safe for out of order, can this be triggered by pre_ack?
def msg_acked():
# XXX: should we log the ack somehow too?
snd.acked += 1
@@ -1243,7 +1246,8 @@ class Engine:
if dp.delivery_mode is not None:
msg.durable = dp.delivery_mode == delivery_mode.persistent
msg.priority = dp.priority
- msg.ttl = dp.ttl
+ if dp.ttl is not None:
+ msg.ttl = dp.ttl/1000.0
msg.redelivered = dp.redelivered
msg.properties = mp.application_headers or {}
if mp.app_id is not None:
diff --git a/python/qpid/messaging/message.py b/python/qpid/messaging/message.py
index a96a6da0ac..e2406f16e7 100644
--- a/python/qpid/messaging/message.py
+++ b/python/qpid/messaging/message.py
@@ -74,12 +74,20 @@ class Message:
@type id: str
@ivar id: the message id
+ @type subject: str
+ @ivar subject: message subject
@type user_id: str
@ivar user_id: the user-id of the message producer
@type reply_to: str
@ivar reply_to: the address to send replies
@type correlation_id: str
@ivar correlation_id: a correlation-id for the message
+ @type durable: bool
+ @ivar durable: message durability
+ @type priority: int
+ @ivar priority: message priority
+ @type ttl: float
+ @ivar ttl: time-to-live measured in seconds
@type properties: dict
@ivar properties: application specific message properties
@type content_type: str