Hi Chege,
From reading ActiveMQ’s documentation, I think that your goal cannot be achieved using Tomcat and ActiveMQ. In fact, from the documentation:
“manually integrating ActiveMQ with Tomcat does allow for Topic, Queue, and ConnectionFactory injection but does NOT support transactional sending and delivery.”
To answer your question:
Should I use JCA connector that comes with activemq? How to I configure activemq connection factory to participate in a JTA transaction?
ActiveMQ can be used in XA transactions, which can be managed using Narayana. For example, an option would be to use TomEE and integrate it with Narayana. You should then be able to run XA transactions enlisting ActiveMQ and PostgreSQL.
Manuel