messages got from the queue are saved in the database