You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by mymacin <my...@yahoo.com> on 2011/05/27 11:37:31 UTC
SOAP over JMS Transactions
I am trying to achieve transactions with SOAP over JMS .Basing on
JMSfeatures i have configured jms end points.But I am unable to achieve
transactions.I am using spring declarative @transactions but the transaction
is not propagating with the jms message. Please check the below code and let
me know if anything wrong with configuration.
In the client end:
<jaxws:client id="greeterJMSImplService"
xmlns:greeterJMSImplService="http://cxf.apache.org/jms_greeter"
serviceName="greeterJMSImplService:GreeterJMSImplService"
address="jms://"
serviceClass="foo.service.GreeterJMS">
<jaxws:features>
<bean xmlns="http://www.springframework.org/schema/beans"
class="org.apache.cxf.transport.jms.JMSConfigFeature"
><property name="jmsConfig" >
<bean
class="org.apache.cxf.transport.jms.JMSConfiguration"
p:connectionFactory-ref="jmsConnectionFactory"
p:targetDestination="SampleQueue2"
p:useJms11="true"
p:sessionTransacted="true"
p:transactionManager-ref="JTAtransactionManager"
/>
</property>
</bean>
</jaxws:features>
</jaxws:client>
in the publisher end:
<jaxws:endpoint
address="jms://"
xmlns:customerService="http://cxf.apache.org/customer_service"
serviceName="customerService:CustomerService"
implementor="#CustomerService">
<jaxws:features>
<bean class="org.apache.cxf.transport.jms.JMSConfigFeature">
<property name="jmsConfig" >
<bean
class="org.apache.cxf.transport.jms.JMSConfiguration"
p:connectionFactory-ref="jmsConnectionFactory"
p:targetDestination="SampleQueue1"
p:useJms11="true"
p:sessionTransacted="true"
p:transactionManager-ref="JTAtransactionManager"
/>
</property>
</bean>
</jaxws:features>
</jaxws:endpoint>
--
View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4431341.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SOAP over JMS Transactions
Posted by mymacin <my...@yahoo.com>.
Yes I have tried with p:useJms11="false" but no use.
--
View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4431408.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SOAP over JMS Transactions
Posted by Freeman Fang <fr...@gmail.com>.
Hi,
Could you try with p:useJms11="false"?
Freeman
On 2011-5-27, at 下午5:37, mymacin wrote:
>
> I am trying to achieve transactions with SOAP over JMS .Basing on
> JMSfeatures i have configured jms end points.But I am unable to
> achieve
> transactions.I am using spring declarative @transactions but the
> transaction
> is not propagating with the jms message. Please check the below code
> and let
> me know if anything wrong with configuration.
>
> In the client end:
>
> <jaxws:client id="greeterJMSImplService"
> xmlns:greeterJMSImplService="http://cxf.apache.org/jms_greeter"
> serviceName="greeterJMSImplService:GreeterJMSImplService"
> address="jms://"
> serviceClass="foo.service.GreeterJMS">
>
> <jaxws:features>
> <bean xmlns="http://www.springframework.org/schema/beans"
> class="org.apache.cxf.transport.jms.JMSConfigFeature"
> ><property name="jmsConfig" >
> <bean
> class="org.apache.cxf.transport.jms.JMSConfiguration"
> p:connectionFactory-ref="jmsConnectionFactory"
> p:targetDestination="SampleQueue2"
> p:useJms11="true"
> p:sessionTransacted="true"
> p:transactionManager-ref="JTAtransactionManager"
> />
> </property>
> </bean>
> </jaxws:features>
> </jaxws:client>
>
>
>
> in the publisher end:
>
> <jaxws:endpoint
> address="jms://"
> xmlns:customerService="http://cxf.apache.org/customer_service"
> serviceName="customerService:CustomerService"
> implementor="#CustomerService">
>
> <jaxws:features>
> <bean class="org.apache.cxf.transport.jms.JMSConfigFeature">
> <property name="jmsConfig" >
> <bean
> class="org.apache.cxf.transport.jms.JMSConfiguration"
> p:connectionFactory-ref="jmsConnectionFactory"
> p:targetDestination="SampleQueue1"
> p:useJms11="true"
> p:sessionTransacted="true"
> p:transactionManager-ref="JTAtransactionManager"
> />
> </property>
> </bean>
> </jaxws:features>
>
> </jaxws:endpoint>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4431341.html
> Sent from the cxf-user mailing list archive at Nabble.com.
---------------------------------------------
Freeman Fang
FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
Connect at CamelOne May 24-26
The Open Source Integration Conference
Re: SOAP over JMS Transactions
Posted by mymacin <my...@yahoo.com>.
@Christian Schneider
In my previous post you can find that I have already wired
JTAtransactionManager into Jmsconfiguration.
Some thing like this:-
p:transactionManager-ref="JTAtransactionManager"
--
View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4431814.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: SOAP over JMS Transactions
Posted by Christian Schneider <ch...@die-schneider.net>.
I think you have to wire the transactionmanager into the JmsConfiguration.
See:
http://cxf.apache.org/docs/using-the-jmsconfigfeature.html
Christian
Am 27.05.2011 12:17, schrieb mymacin:
> Here is my spring bean configuration
>
>
>
> <context:component-scan base-package="foo"/>
> <context:annotation-config />
>
>
> <aop:config />
>
>
> <bean id="entityManagerFactory"
> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
> <property name="jpaVendorAdapter">
> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
> p:database="MYSQL" p:showSql="false"/>
> </property>
>
>
> </bean>
>
> <bean id="JTAtransactionManager"
> class="org.springframework.transaction.jta.JtaTransactionManager">
> <property name="transactionManagerName"
> value="java:/TransactionManager"/>
> <property name="userTransactionName" value="UserTransaction"/>
>
> </bean>
>
> <context:annotation-config/>
>
> <tx:annotation-driven transaction-manager="JTAtransactionManager"/>
>
> <bean
> class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
>
>
>
> <bean id="jmsConnectionFactory"
> class="org.springframework.jms.connection.SingleConnectionFactory">
> <property name="targetConnectionFactory">
> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL" value="tcp://localhost:61616" />
> </bean>
> </property>
> </bean>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4431433.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
Re: AW: SOAP over JMS Transactions
Posted by mymacin <my...@yahoo.com>.
Here is my spring bean configuration
<context:component-scan base-package="foo"/>
<context:annotation-config />
<aop:config />
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:database="MYSQL" p:showSql="false"/>
</property>
</bean>
<bean id="JTAtransactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName"
value="java:/TransactionManager"/>
<property name="userTransactionName" value="UserTransaction"/>
</bean>
<context:annotation-config/>
<tx:annotation-driven transaction-manager="JTAtransactionManager"/>
<bean
class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
<bean id="jmsConnectionFactory"
class="org.springframework.jms.connection.SingleConnectionFactory">
<property name="targetConnectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
</property>
</bean>
--
View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4431433.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: AW: SOAP over JMS Transactions
Posted by Guy Pardon <gu...@me.com>.
Should be easy if you configure www.atomikos.com as the spring transaction manager and use the atomikos jdbc/jms connector beans...
Sent from my iPad
On 27-mei-2011, at 15:43, mymacin <my...@yahoo.com> wrote:
> @Willem.Jiang
>
> I want to make it work with spring Transaction with JMS . I have one doubt
> on this ,is it possible to combine JMS transaction and spring JPA
> transaction at the same time?
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4432038.html
> Sent from the cxf-user mailing list archive at Nabble.com.
Re: AW: SOAP over JMS Transactions
Posted by Willem Jiang <wi...@gmail.com>.
On 5/27/11 9:43 PM, mymacin wrote:
> @Willem.Jiang
>
> I want to make it work with spring Transaction with JMS . I have one doubt
> on this ,is it possible to combine JMS transaction and spring JPA
> transaction at the same time?
>
I think you can do a simple test by throwing an exception in your
application code, and don't delegate the request to JPA.
Then you can check if the JMS request message still in the queue.
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com
Re: AW: SOAP over JMS Transactions
Posted by mymacin <my...@yahoo.com>.
@Willem.Jiang
I want to make it work with spring Transaction with JMS . I have one doubt
on this ,is it possible to combine JMS transaction and spring JPA
transaction at the same time?
--
View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4432038.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: AW: SOAP over JMS Transactions
Posted by Willem Jiang <wi...@gmail.com>.
Hi,
I just found you want to combine the JMS transcation and JPA together.
Not sure if these two resource can work together with the JTA
transaction manager.
On 5/27/11 6:14 PM, mymacin wrote:
> Here is my spring bean configuration
>
>
> <context:component-scan base-package="foo"/>
> <context:annotation-config />
>
>
> <aop:config />
>
>
> <bean id="entityManagerFactory"
> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
> <property name="jpaVendorAdapter">
> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
> p:database="MYSQL" p:showSql="false"/>
> </property>
>
>
> </bean>
>
> <bean id="transactionManager"
> class="org.springframework.transaction.jta.JtaTransactionManager">
> <property name="transactionManagerName"
> value="java:/TransactionManager"/>
> <property name="userTransactionName" value="UserTransaction"/>
>
> </bean>
>
> <context:annotation-config/>
>
> <tx:annotation-driven transaction-manager="transactionManager"/>
>
> <bean
> class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
>
>
>
> <bean id="jmsConfig"
> class="org.apache.cxf.transport.jms.JMSConfiguration"
> p:connectionFactory-ref="jmsConnectionFactory"
> p:targetDestination="SampleQueue2"
> />
>
> <bean id="jmsConfig1"
> class="org.apache.cxf.transport.jms.JMSConfiguration"
> p:connectionFactory-ref="jmsConnectionFactory"
> p:targetDestination="SampleQueue1"
> />
>
> <bean id="jmsConnectionFactory"
> class="org.springframework.jms.connection.SingleConnectionFactory">
> <property name="targetConnectionFactory">
> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL" value="tcp://localhost:61616" />
> </bean>
> </property>
> </bean>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4431422.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com
Re: AW: SOAP over JMS Transactions
Posted by mymacin <my...@yahoo.com>.
Here is my spring bean configuration
<context:component-scan base-package="foo"/>
<context:annotation-config />
<aop:config />
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:database="MYSQL" p:showSql="false"/>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName"
value="java:/TransactionManager"/>
<property name="userTransactionName" value="UserTransaction"/>
</bean>
<context:annotation-config/>
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean
class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
<bean id="jmsConfig"
class="org.apache.cxf.transport.jms.JMSConfiguration"
p:connectionFactory-ref="jmsConnectionFactory"
p:targetDestination="SampleQueue2"
/>
<bean id="jmsConfig1"
class="org.apache.cxf.transport.jms.JMSConfiguration"
p:connectionFactory-ref="jmsConnectionFactory"
p:targetDestination="SampleQueue1"
/>
<bean id="jmsConnectionFactory"
class="org.springframework.jms.connection.SingleConnectionFactory">
<property name="targetConnectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
</property>
</bean>
--
View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4431422.html
Sent from the cxf-user mailing list archive at Nabble.com.
AW: SOAP over JMS Transactions
Posted by Christian Schneider <cs...@talend.com>.
Did you set up a spring transaction manager bean? You will need it.
Christian
-----Ursprüngliche Nachricht-----
Von: mymacin [mailto:mymacin@yahoo.com]
Gesendet: Freitag, 27. Mai 2011 11:38
An: users@cxf.apache.org
Betreff: SOAP over JMS Transactions
I am trying to achieve transactions with SOAP over JMS .Basing on JMSfeatures i have configured jms end points.But I am unable to achieve transactions.I am using spring declarative @transactions but the transaction is not propagating with the jms message. Please check the below code and let me know if anything wrong with configuration.
In the client end:
<jaxws:client id="greeterJMSImplService"
xmlns:greeterJMSImplService="http://cxf.apache.org/jms_greeter"
serviceName="greeterJMSImplService:GreeterJMSImplService"
address="jms://"
serviceClass="foo.service.GreeterJMS">
<jaxws:features>
<bean xmlns="http://www.springframework.org/schema/beans"
class="org.apache.cxf.transport.jms.JMSConfigFeature"
><property name="jmsConfig" >
<bean
class="org.apache.cxf.transport.jms.JMSConfiguration"
p:connectionFactory-ref="jmsConnectionFactory"
p:targetDestination="SampleQueue2"
p:useJms11="true"
p:sessionTransacted="true"
p:transactionManager-ref="JTAtransactionManager"
/>
</property>
</bean>
</jaxws:features>
</jaxws:client>
in the publisher end:
<jaxws:endpoint
address="jms://"
xmlns:customerService="http://cxf.apache.org/customer_service"
serviceName="customerService:CustomerService"
implementor="#CustomerService">
<jaxws:features>
<bean class="org.apache.cxf.transport.jms.JMSConfigFeature">
<property name="jmsConfig" >
<bean
class="org.apache.cxf.transport.jms.JMSConfiguration"
p:connectionFactory-ref="jmsConnectionFactory"
p:targetDestination="SampleQueue1"
p:useJms11="true"
p:sessionTransacted="true"
p:transactionManager-ref="JTAtransactionManager"
/>
</property>
</bean>
</jaxws:features>
</jaxws:endpoint>
--
View this message in context: http://cxf.547215.n5.nabble.com/SOAP-over-JMS-Transactions-tp4431341p4431341.html
Sent from the cxf-user mailing list archive at Nabble.com.