Skip to content

Instantly share code, notes, and snippets.

@curtisforrester
Created March 10, 2016 13:15
Show Gist options
  • Save curtisforrester/9e087cc2b993d2bb91eb to your computer and use it in GitHub Desktop.
Save curtisforrester/9e087cc2b993d2bb91eb to your computer and use it in GitHub Desktop.
exchange = Exchange(CONSUMER_EXCHANGE, type='direct')
lookout_queue = Queue('lookout_rep', exchange, CONSUMER_QUEUE_ROUTING_KEY)
class LookoutConsumerStep(bootsteps.ConsumerStep):
def get_consumers(self, channel):
return [Consumer(channel, queues=[lookout_queue], callbacks=[self.handle_message], accept=['json'])]
def handle_message(self, body, message):
from DNotify.logic.replication import handle_replication_message
handle_replication_message(message=body)
message.ack()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment