MCPcopy Create free account
hub / github.com/diffgram/diffgram / send_message

Method send_message

shared/queueclient/QueueClient.py:62–79  ·  view source on GitHub ↗

Publishes a message to rabbit MQ. For now its using the default actions exchange. But we can modify this wrapper to include more paremeters for the exchange name. :param message: :param routing_key: :param exchange: :return:

(self,
                     message: dict,
                     routing_key: str,
                     exchange: str)

Source from the content-addressed store, hash-verified

60 exchange_type = ExchangeType.direct.value)
61
62 def send_message(self,
63 message: dict,
64 routing_key: str,
65 exchange: str):
66 """
67 Publishes a message to rabbit MQ. For now its using the default
68 actions exchange. But we can modify this wrapper to include more paremeters
69 for the exchange name.
70 :param message:
71 :param routing_key:
72 :param exchange:
73 :return:
74 """
75 self.main_channel.basic_publish(
76 exchange = exchange,
77 routing_key = routing_key,
78 body = json.dumps(message).encode('utf-8'),
79 properties = pika.BasicProperties(content_type = 'application/json'))

Callers 6

remove_job_schedulingFunction · 0.95
add_job_schedulingFunction · 0.95
broadcastMethod · 0.95
process_new_eventMethod · 0.95
trigger_workflowFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected