reading and publishing from queue