dralley is saying your queue push and database write aren't transactional. You have to be ok suffering some small % of message loss or messages sent without a database commit
If there is a two phase process then you just need idempotence and can safely transact with the db.