def _make_publisher(self):
bus_url = 'amqp://{username}:{password}@{host}:{port}//'.format(**self.config)
bus_connection = Connection(bus_url)
bus_exchange = Exchange(self.config['exchange_name'], type=self.config['exchange_type'])
bus_producer = Producer(bus_connection, exchange=bus_exchange, auto_declare=True)
bus_marshaler = Marshaler(self._uuid)
return Publisher(bus_producer, bus_marshaler)
评论列表
文章目录