Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5293

XA transaction for soap over jms not fully working

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.7.6
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      weblogic 11g with cxf 2.7.6 and spring 3.2.0

    • Estimated Complexity:
      Unknown

      Description

      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.

          <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"/>
      

      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.

      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");
      		}
      	}	
      }
      

      everything works fine. means when outbound queue production paused, the message was send to dead letter queue and db change reverted.

        Attachments

          Activity

            People

            • Assignee:
              cschneider Christian Schneider
              Reporter:
              angelfox Nan Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: