read from queue, write json