Send message_id as property
message_id field should be sent as message property, not as field in message headers Change-Id: I2eaa705673408b4cdacf8571072312ddbf8efd69 Closes-Bug: #1322078
This commit is contained in:
parent
453c707a06
commit
9beefcc4b2
@ -25,7 +25,7 @@ class Message(object):
|
||||
self._connection = connection
|
||||
self._message_handle = message_handle
|
||||
self.id = None if message_handle is None else \
|
||||
message_handle.headers.get('message_id')
|
||||
message_handle.properties.get('message_id')
|
||||
try:
|
||||
self.body = None if message_handle is None else \
|
||||
anyjson.loads(message_handle.body)
|
||||
|
@ -91,14 +91,12 @@ class MqClient(object):
|
||||
if not self._connected:
|
||||
raise RuntimeError('Not connected to RabbitMQ')
|
||||
|
||||
headers = {'message_id': str(message.id)}
|
||||
|
||||
producer = kombu.Producer(self._connection)
|
||||
producer.publish(
|
||||
exchange=str(exchange),
|
||||
routing_key=str(key),
|
||||
body=anyjson.dumps(message.body),
|
||||
headers=headers
|
||||
message_id=str(message.id)
|
||||
)
|
||||
|
||||
def open(self, queue, prefetch_count=1):
|
||||
|
Loading…
Reference in New Issue
Block a user