def METHOD_NAME(self, session, queue_url, resource_id=None):
    # lazy import to avoid circular
    from c7n.sqsexec import MessageIterator
    client = session.client("sqs")
    messages = MessageIterator(client, queue_url, timeout=20)
    results = []
    while True:
        for m in messages:
            msg = json.loads(m["Body"])
            change = json.loads(msg["Message"])
            messages.ack(m)
            if resource_id and change["configurationItem"]["resourceId"] != resource_id:
                continue
            results.append(change["configurationItem"])
            break
        if results:
            break
    return results