Skip to content
Snippets Groups Projects
Commit 9e2f78c2 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Add properties support when publish msg

parent eb0d488b
No related branches found
No related tags found
4 merge requests!147Merge previous default branch feat-cod-rmq into main,!113WIP: Feat block user,!112User state agent,!111Update rcrmq class
...@@ -109,6 +109,7 @@ class RCRMQ(object): ...@@ -109,6 +109,7 @@ class RCRMQ(object):
def publish_msg(self, obj): def publish_msg(self, obj):
routing_key = obj.get("routing_key") routing_key = obj.get("routing_key")
props = obj.get("props")
if self._connection is None: if self._connection is None:
self.connect() self.connect()
...@@ -116,6 +117,7 @@ class RCRMQ(object): ...@@ -116,6 +117,7 @@ class RCRMQ(object):
self._channel.basic_publish( self._channel.basic_publish(
exchange=self.EXCHANGE, exchange=self.EXCHANGE,
routing_key=routing_key, routing_key=routing_key,
properties=props,
body=json.dumps(obj["msg"]), body=json.dumps(obj["msg"]),
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment