CXF supports resource local jms transactions and JTA transactions on CXF endpoints when using one way messages.
Resource local JMS transactions
This kind of transaction is easy to configure but will only roll back the JMS message. It will not directly coordinate other resources like a database transaction.
Simply configure the endpoint normally and set the property "sessionTransacted" to true. CXF will then roll back the message on if any exception happens.
JTA transactions allow to coordinate any number of XA resources. If a CXF endpoint is configured for JTA transactions it will start a JTA transaction before calling the service impl. If no exceptions happen the transaction will be committed in case of any exception the transaction will be rolled back. This allows to e.g. transactionally consume a JMS message and write the data into a database. In case of an exception both resources will be rolled back. So either the message is consumed AND the database record is written or the message is rolled back AND the database record is not written.
The first config needed for JTA is a transaction manager:
Either create a transaction manager in a bean using:
as an OSGi service reference. (This search filter can vary between application servers).
Then the name of the TransactionManager can be set in the JMS URI
The first would find a bean with id "TransactionManager" the second would look up the transaction manager in JNDI.
The second config is a JCA pooling connection factory
This first defines an ActiveMQ XA connection factory. This is then given to a JcaPoolingConnectionFactory which is then provided as the default bean with id "ConnectionFactory".