Write queue to es.