async def METHOD_NAME():
    servicebus_client = ServiceBusClient.from_connection_string(conn_str=CONNECTION_STR)
    async with servicebus_client:
        async with servicebus_client.get_queue_sender(queue_name=QUEUE_NAME) as sender:
            await sender.send_messages(ServiceBusMessage("message"))
        async with AutoLockRenewer() as renewer:
            # For this sample we're going to set the renewal recurrence of the autolockrenewer to greater than the
            # service side message lock duration, to demonstrate failure.  Normally, this should not be adjusted.
            renewer._sleep_time = 40
            async with servicebus_client.get_queue_receiver(queue_name=QUEUE_NAME, prefetch_count=10) as receiver:
                async def on_lock_renew_failure_callback(renewable, error):
                    # If auto-lock-renewal fails, this function will be called.
                    # If failure is due to an error, the second argument will be populated, otherwise
                    # it will default to `None`.
                    # This callback can be an ideal location to log the failure, or take action to safely
                    # handle any processing on the message or session that was in progress.
                    print("Intentionally failed to renew lock on {} due to {}".format(renewable, error))
                received_msgs = await receiver.receive_messages(max_message_count=1, max_wait_time=5)
                for msg in received_msgs:
                    # automatically renew the lock on each message for 120 seconds
                    renewer.register(receiver,
                                     msg,
                                     max_lock_renewal_duration=90,
                                     on_lock_renew_failure=on_lock_renew_failure_callback)
                print('Register messages into AutoLockRenewer done.')
                # Cause the messages and autorenewal to time out.
                # Other reasons for renew failure could include a network or service outage.
                await asyncio.sleep(80)
                try:
                    for msg in received_msgs:
                        await receiver.complete_message(msg)
                except ServiceBusError as e:
                    print('Messages cannot be settled if they have timed out. (This is expected)')
                print('Lock renew failure demonstration complete.')