async def send_test_message(i): print("sending message #" + str(i)) msg = Message("test wind speed " + str(i)) msg.message_id = uuid.uuid4() msg.correlation_id = "correlation-1234" msg.custom_properties["tornado-warning"] = "yes" await device_client.send_d2c_message(msg) print("done sending message #" + str(i))
def create_fake_output_message(): msg = Message(fake_event) msg.message_id = fake_message_id msg.output_name = "fake_output_name" return msg
def get_random_message(total_payload_length=0): message = Message(json.dumps(get_random_dict(total_payload_length))) message.content_type = const.JSON_CONTENT_TYPE message.content_encoding = const.JSON_CONTENT_ENCODING message.message_id = str(uuid.uuid4()) return message
def create_fake_message(): msg = Message(fake_event) msg.message_id = fake_message_id msg.custom_properties[custom_property_name] = custom_property_value return msg