cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nan <nanxu1...@gmail.com>
Subject cxf enable jta transaction on jms transport
Date Fri, 13 Sep 2013 22:57:12 GMT
I am using cxf 2.7.6 and trying to receive soap message over jms. 

I need to get messge from inbound queue, process it(DB action), then
response back to the outbound queue. at any phrase when problem happen, the
DB action should be reverted.

The message can be received, processed and sent back correctly, but I
noticed that there is no transaction. I prefer use spring transaction
annotation, but I found there is no good place for me to put it. I want to
start the tx when I get jms message, so when I process the message
right(update DB) and send back message has problem, the DB change can be
reverted.
all my resources are XAResource.
here is my configuration.


<jaxws:endpoint id="tasaJmsServiceEndPoint" address="jms://" 
implementor="#tasaWebServiceOverJms">
		<jaxws:features>
			<bean class="org.apache.cxf.transport.jms.JMSConfigFeature"
p:jmsConfig-ref="tasaJmsConfig" />
			<wsa:addressing xmlns:wsa="http://cxf.apache.org/ws/addressing"
allowDuplicates="true" usingAddressingAdvisory="true"/>
		</jaxws:features>
	</jaxws:endpoint>

	<bean id="tasaJmsConfig"
class="org.apache.cxf.transport.jms.JMSConfiguration"
		p:connectionFactory-ref="tasaConnectionFactory" 
		p:targetDestination="tasaInboundQueue"
		p:replyDestination="tasaOutboundQueue"
		p:destinationResolver-ref="jmsDestinationResolver"
		p:transactionManager-ref="transactionManager"
		/>    
<jee:jndi-lookup id="tasaConnectionFactory"
jndi-name="mqForeignConnectionFactory" />

<tx:jta-transaction-manager/>
<bean id="jmsDestinationResolver"
class="org.springframework.jms.support.destination.JndiDestinationResolver"
p:resourceRef="true"/>


@WebService(
       
endpointInterface="com.webservice.service.TasaWebServiceOverJmsEndPoint",
        serviceName="TasaServiceOverJms",
        portName="TasaServiceverJmsPort")
@Addressing(enabled=true, required=false)
@Transactional  //* I really doubt I want to put a transactional here, it
should start ealier than here.*
public class TasaWebServiceOverJmsEndPointImpl implements
TasaWebServiceOverJmsEndPoint {




--
View this message in context: http://cxf.547215.n5.nabble.com/cxf-enable-jta-transaction-on-jms-transport-tp5734088.html
Sent from the cxf-user mailing list archive at Nabble.com.

Mime
View raw message