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

Add auto-generate queue support

parent e04cfab2
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
...@@ -87,16 +87,18 @@ class RCRMQ(object): ...@@ -87,16 +87,18 @@ class RCRMQ(object):
if self._connection is None: if self._connection is None:
self.connect() self.connect()
self._channel.queue_declare( result = self._channel.queue_declare(
queue=queue, durable=durable, exclusive=exclusive queue=queue, durable=durable, exclusive=exclusive
) )
self._channel.queue_bind( self._channel.queue_bind(
exchange=self.EXCHANGE, exchange=self.EXCHANGE,
queue=queue, queue=result.method.queue,
routing_key=routing_key, routing_key=routing_key,
) )
return result.method.queue
def disconnect(self): def disconnect(self):
self._channel.close() self._channel.close()
self._connection.close() self._connection.close()
......
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