def setUp(self): config = TestConfig() self._connection = Connection(config.broker_uri, "paramore.brightside.exchange", is_durable=True) self._producer = ArameProducer(self._connection) self._pipeline = Queue()
def run(): message_store = FakeMessageStore() message_mapper_registry = MessageMapperRegistry() message_mapper_registry.register(HelloWorldCommand, map_hellworldcommand_to_message) connection = Connection("amqp://*****:*****@localhost:5672//", "paramore.brightside.exchange", is_durable=True) producer = ArameProducer(connection) command_processor = CommandProcessor( message_mapper_registry=message_mapper_registry, message_store=message_store, producer=producer) try: loop = 0 while True: message = "Hello " + str(loop) hello = HelloWorldCommand(message) print("Sending message: {}".format(message)) command_processor.post(hello) loop += 1 if loop % 100 == 0: time.sleep(5) except KeyboardInterrupt: sys.exit(1)
def setUp(self): config = TestConfig() self._connection = Connection(config.broker_uri, "paramore.brightside.exchange", is_durable=True) self._producer = ArameProducer(self._connection) self._pipeline = Queue() self._consumer = ArameConsumer( self._connection, BrightsideConsumerConfiguration(self._pipeline, "brightside_tests", self.test_topic))
def run(): message_store = FakeMessageStore() message_mapper_registry = MessageMapperRegistry() message_mapper_registry.register(LongRunningCommand, map_longrunningcommand_to_message) connection = Connection("amqp://*****:*****@localhost:5672//", "paramore.brightside.exchange", is_durable=True) producer = ArameProducer(connection) command_processor = CommandProcessor( message_mapper_registry=message_mapper_registry, message_store=message_store, producer=producer) job = LongRunningCommand(60) command_processor.post(job)
def run(): parser = argparse.ArgumentParser() parser.add_argument("name", help="the name to send a greeting to") args = parser.parse_args() message_store = FakeMessageStore() message_mapper_registry = MessageMapperRegistry() message_mapper_registry.register(HelloWorldCommand, map_hellworldcommand_to_message) connection = Connection("amqp://*****:*****@localhost:5672//", "paramore.brightside.exchange", is_durable=True) producer = ArameProducer(connection) command_processor = CommandProcessor( message_mapper_registry=message_mapper_registry, message_store=message_store, producer=producer ) hello = HelloWorldCommand(args.name) command_processor.post(hello)
def setUp(self): self._connection = ArameConnection("amqp://*****:*****@localhost:5672//", "paramore.brighter.exchange") self._producer = ArameProducer(self._connection) self._consumer = ArameConsumer(self._connection, "brightside_tests", self.test_topic)