cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schneider (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5293) XA transaction for soap over jms not fully working
Date Mon, 07 Jul 2014 11:53:33 GMT

    [ https://issues.apache.org/jira/browse/CXF-5293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14053567#comment-14053567
] 

Christian Schneider commented on CXF-5293:
------------------------------------------

I think there are some bigger problems in the CXF 2 transaction support. In CXF 3 I completely
redesigned the inner structure of the CXF JMS transport. Can you check if switiching to CXF
3 makes XA transactions fully work for you?

If it works can we then close this issue? I think solving the transaction support for cxf
2 would be a lot of work.

> XA transaction for soap over jms not fully working
> --------------------------------------------------
>
>                 Key: CXF-5293
>                 URL: https://issues.apache.org/jira/browse/CXF-5293
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, Integration, Transports
>    Affects Versions: 2.7.6
>         Environment: weblogic 11g with cxf 2.7.6 and spring 3.2.0
>            Reporter: Nan Xu
>
> trying to achieve such a scenario.
> 1. soap message was sent to a inbound queue.
> 2. cxf pick up the soap message from inbound queue, then process it(do a database update)
> 3. response message send to outbound queue.
> expected behavior:
> when the outbound message can not be sent. the database change rollback, and inbound
message was send back to the dead letter queue, which is configured at inbound queue failed
delivery setting.(based on redelivery time)
> cxf configuration.
> {code:xml}
>     <bean id="dbService" class="com.test.DBActionImpl"/>    <!--update DB-->
>     
>      <jaxws:endpoint id="dbServiceEndPoint" implementor="#dbService" address="jms://">
> 		<jaxws:features>
> 			<bean class="org.apache.cxf.transport.jms.JMSConfigFeature" p:jmsConfig-ref="jmsConfig"
/>
> 		</jaxws:features>
> 	</jaxws:endpoint>
>  
>  	<bean id="jmsConfig" class="org.apache.cxf.transport.jms.JMSConfiguration"
> 		p:connectionFactory-ref="connectionFactory" 
> 		p:targetDestination="inboundQueue"
> 		p:replyDestination="outboundQueue"
> 		p:destinationResolver-ref="jmsDestinationResolver"
> 		p:transactionManager-ref="transactionManager"
> 	/> 
>         <bean id="jmsDestinationResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver"
p:resourceRef="true"/>
> {code}
> all the db datasource, jms connection factory and transaction manager are XA.
> I pause the outbound queue production in weblogic to generate the outbound message sending
error.
> problem:
> No message was send to Dead Letter Queue and DB change get committed.
> tried with a standard spring jms listener in this way.
> {code:java}
> public class MyMessageListener implements MessageListener {
> 	
> 	@Autowired
> 	private DBAction dbAction;
> 	
> 	@Autowired
> 	private ResponseSender responseSender;  //jms sender use jmsTemplate
> 	@Override
> 	public void onMessage(Message message) {
> 		if (message instanceof TextMessage) {
> 			try {
> 				System.out.println("I get message:  "+ ((TextMessage) message).getText());
> 				
> 				dbAction.updateDb();
> 				
> 				responseSender.sendResponse();
> 				
> 			} catch (JMSException ex) {
> 				throw new RuntimeException(ex);
> 			}
> 		} else {
> 			throw new IllegalArgumentException("Message must be of type TextMessage");
> 		}
> 	}	
> }
> {code}
> everything works fine. means when outbound queue production paused, the message was send
to dead letter queue and db change reverted.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message