summaryrefslogtreecommitdiff
path: root/python/qpid/messaging
diff options
context:
space:
mode:
Diffstat (limited to 'python/qpid/messaging')
-rw-r--r--python/qpid/messaging/driver.py6
-rw-r--r--python/qpid/messaging/message.py7
2 files changed, 11 insertions, 2 deletions
diff --git a/python/qpid/messaging/driver.py b/python/qpid/messaging/driver.py
index 3712bdd221..d0f5b746f3 100644
--- a/python/qpid/messaging/driver.py
+++ b/python/qpid/messaging/driver.py
@@ -1057,6 +1057,10 @@ class Engine:
mp.application_headers[TO] = msg.to
if msg.durable:
dp.delivery_mode = delivery_mode.persistent
+ if msg.priority is not None:
+ dp.priority = msg.priority
+ if msg.ttl is not None:
+ dp.ttl = msg.ttl
enc, dec = get_codec(msg.content_type)
body = enc(msg.content)
def msg_acked():
@@ -1106,6 +1110,8 @@ class Engine:
msg.reply_to = reply_to2addr(mp.reply_to)
msg.correlation_id = mp.correlation_id
msg.durable = dp.delivery_mode == delivery_mode.persistent
+ msg.priority = dp.priority
+ msg.ttl = dp.ttl
msg.redelivered = dp.redelivered
msg.properties = mp.application_headers
msg.content_type = mp.content_type
diff --git a/python/qpid/messaging/message.py b/python/qpid/messaging/message.py
index 1c7c7beb81..46494e428e 100644
--- a/python/qpid/messaging/message.py
+++ b/python/qpid/messaging/message.py
@@ -90,7 +90,8 @@ class Message:
def __init__(self, content=None, content_type=UNSPECIFIED, id=None,
subject=None, to=None, user_id=None, reply_to=None,
- correlation_id=None, durable=None, properties=None):
+ correlation_id=None, durable=None, priority=None, ttl=None,
+ properties=None):
"""
Construct a new message with the supplied content. The
content-type of the message will be automatically inferred from
@@ -109,6 +110,8 @@ class Message:
self.reply_to = reply_to
self.correlation_id = correlation_id
self.durable = durable
+ self.priority = priority
+ self.ttl = ttl
self.redelivered = False
if properties is None:
self.properties = {}
@@ -123,7 +126,7 @@ class Message:
def __repr__(self):
args = []
for name in ["id", "subject", "to", "user_id", "reply_to",
- "correlation_id"]:
+ "correlation_id", "priority", "ttl"]:
value = self.__dict__[name]
if value is not None: args.append("%s=%r" % (name, value))
for name in ["durable", "properties"]: