Hi Willem,

I have adjusted my applicationContext but still my message gets acknowledged
instead of being rolled back.

My service impl contains:
  throw new RuntimeException("Test for transaction");

Any idea what still goes wrong?

Greetings

Christian

----

My applicationcontext now looks like the following. I have also added
<transacted/> to the route for the server.



<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xmlns:context="http://www.springframework.org/schema/context";
        xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
                http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
                http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
                http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
                http://cxf.apache.org/transports/camel
http://cxf.apache.org/transports/camel.xsd";
>
<context:annotation-config/>

        <import resource="classpath:META-INF/cxf/cxf.xml" />
        <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
        <import resource="classpath:META-INF/cxf/cxf-extension-camel.xml" />
        <import resource="classpath:serviceRuntimeContext.xml" />
        
        <bean id="configProps"
        
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigure
r">
                <property name="locations">
                        <list>
                                <value>classpath:jms.properties</value>
                        </list>
                </property>
        </bean>
                        
        <!-- Make sure to read the best practices for design and
implementation before
                 developing a service for production use.
                 http://wissen.enbw.net/display/etgsoa/3+-+Design
                 http://wissen.enbw.net/display/etgsoa/4+-+Entwicklung
        -->
        <bean id="appModule" class="net.enbw.endur.AppModule">
                <property name="customerService" ref="customerService"/>
        </bean>
        
        <bean id="serviceImpl" class="net.enbw.endur.ServiceImpl">
        </bean>

        <!-- SOA configs below  -->
        
        <endpoint id="customerServiceEndpoint"
xmlns="http://cxf.apache.org/jaxws";
                xmlns:service="http://examples.etg.services.enbw.net/";
                serviceName="service:CustomerService"
                endpointName="service:CustomerServiceEndpoint"
                address="camel://direct:server"
                implementor="#serviceImpl">
                <features>
                        <!-- Enables logging of SOAP messages. -->
                        <logging xmlns="http://cxf.apache.org/core"; /> 
                </features>
        </endpoint>

        <client id="customerService" xmlns="http://cxf.apache.org/jaxws";
                xmlns:service="http://examples.etg.services.enbw.net/";
                serviceName="service:CustomerService"
                endpointName="service:CustomerServiceEndpoint"
        
serviceClass="net.enbw.services.etg.examples.customerservice.CustomerService
V1"
                address="camel://direct:client">
                <features>
                        <!-- Enables logging of SOAP messages. -->
                        <!-- logging xmlns="http://cxf.apache.org/core"; /-->
                </features>
        </client>

        <camelContext id="camelContext" trace="false"
xmlns="http://camel.apache.org/schema/spring";>
                <route>
                <from uri="direct:client"/>
                <to
uri="jms://queue.net.enbw.services.etg.examples.customerservice.CustomerServ
ice" />
                </route>
                <route>
                <from
uri="jms://queue.net.enbw.services.etg.examples.customerservice.CustomerServ
ice" />
                <transacted/>
                <to uri="direct:server" />
                </route>
        </camelContext>

        <!-- See http://camel.apache.org/jms.html -->
        <bean id="jms"
                class="org.apache.camel.component.jms.JmsComponent">
                <constructor-arg index="0">
                        <ref bean="jmsConfiguration" />
                </constructor-arg>
                <property name="connectionFactory"
ref="jmsConnectionFactory" />
        </bean>
        <bean id="jmsConfiguration"
                class="org.apache.camel.component.jms.JmsConfiguration">
                <property name="useMessageIDAsCorrelationID" value="true" />
                <property name="acknowledgementModeName" value="TRANSACTED"
/>
                <property name="explicitQosEnabled" value="true" />
                <property name="receiveTimeout"
value="${jms.receiveTimeout}" />
                <property name="requestTimeout"
value="${jms.requestTimeout}" />
                <property name="recoveryInterval"
value="${jms.recoveryInterval}" />
                <property name="timeToLive" value="${jms.timeToLive}" />
                <property name="transacted" value="true" />
                <property name="transactedInOut" value="true" />
                <property name="transactionManager"
ref="jmsTransactionManager"/>
        </bean>

        <bean id="jmsTransactionManager"
class="org.springframework.jms.connection.JmsTransactionManager">
                <property name="connectionFactory"
ref="jmsConnectionFactory" />
        </bean>

        <!--  See Tibco EMS documentation  -->
        <bean id="jmsConnectionFactory"
                class="com.tibco.tibjms.TibjmsConnectionFactory">
                <property name="serverUrl" value="${jms.serverUrl}" />
                <property name="userName" value="${jms.userName}" />
                <property name="userPassword" value="${jms.userPassword}" />
                <property name="reconnAttemptCount"
value="${jms.reconnAttemptCount}" />
                <property name="reconnAttemptDelay"
value="${jms.reconnAttemptDelay}" />
        </bean>

</beans>

Reply via email to