Use transaction for msg publish