def reader_test(topics, cons, messages, on_message, wait_on_messages):
     reader = AsyncMessageReader(
         SERVICE, config_topics, value_type=TEXT, consistency=consistency)
     reader.on_message = on_message
     reader.open()
     write_messages(messages, topics)
     wait_on_messages()
     reader.close()
示例#2
0
def consumer(service):
    reader = AsyncMessageReader(service)
    reader.on_message = show_message
    reader.open()
    wait_for_keyboard_interrupt()
    reader.close()