Re: camel + service mix + spring aspect

2009-07-03 Thread Claus Ibsen
>> I have spring core 2.5.6 jar which does not have this method defined.Is my >> POM.xml correct as I think I may need to change the version of the jar to >> make this work. Hi You are using an old version of ServiceMix 3.3.x that uses Spring 2.0.x. And Camel 1.6.0 uses Spring 2.5.x. Camel 1.6.1

Have anybody here tried the tutorial-osgi-camel-part2?

2009-07-03 Thread Kevin.Zhang
I followed the tutorial web page http://camel.apache.org/tutorial-osgi-camel-part2.html, downloaded tutorial-osgi-camel-part2 and tried to build it but no luck. C:\grid-console\reportincident.service>mvn install [INFO] Scanning for projects... [INFO] --

Re: tutorial-osgi-camel-part1

2009-07-03 Thread Kevin.Zhang
It turns out that I have some problems with the bundle I created. Thanks Willem and Charles. -- View this message in context: http://www.nabble.com/tutorial-osgi-camel-part1-tp24315797p24327262.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: camel + service mix + spring aspect

2009-07-03 Thread akshay_ajmani
akshay_ajmani wrote: > > This is my pom.xml > > > camel > camel.trial > 0.0.1-SNAPSHOT > > 4.0.0 > camel.trial > camel-su > jbi-service-unit > A Camel based JBI Service Unit > 0.0.1-SNAPSHOT > http://www.myorganization.org > > install > > >

Re: camel + service mix + spring aspect

2009-07-03 Thread akshay_ajmani
This is my pom.xml camel camel.trial 0.0.1-SNAPSHOT 4.0.0 camel.trial camel-su jbi-service-unit A Camel based JBI Service Unit 0.0.1-SNAPSHOT http://www.myorganization.org install maven-compiler-plugin 1.5 1.5

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Guillaume Nodet
Right, but you must be prepared to have duplicate JMS messages if something wrong happen between the time the data has been written to the DB and the time the JMS message is acked. On Fri, Jul 3, 2009 at 17:20, Claus Ibsen wrote: > On Fri, Jul 3, 2009 at 4:44 PM, Charles Moulliard wrote: >> If I u

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Charles Moulliard
For the moment, I don't generate/send a message in the route. Nevertheless, like we do top of a classical ApplicationServer (WebSphere, ...), it should be interesting to use only one TransactionManager (like Geronimo Tx) and not the one created by Spring for DB stuff, another for JMS and so on. Th

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Claus Ibsen
On Fri, Jul 3, 2009 at 4:44 PM, Charles Moulliard wrote: > If I use as TransactionManager > > org.springframework.orm.hibernate3.HibernateTransactionManager > > in DAO layer > in Spring layer > in Camel route > > instead of > > org.springframework.transaction.PlatformTransactionManager > > It works

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Charles Moulliard
If I use as TransactionManager org.springframework.orm.hibernate3.HibernateTransactionManager in DAO layer in Spring layer in Camel route instead of org.springframework.transaction.PlatformTransactionManager It works. The transaction is well rollbacked ! yes yes yes yes If you find a solu

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Charles Moulliard
Here is a snapshot of the configs used : 1) ActiveMQ ... javax.jms.ConnectionFactory

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Guillaume Nodet
It is certainly possible to do that. You need to configure the JMS connection factory and the JDBC datasource so that they are aware of the transaction manager. How did you set up those resources ? They are the critical ones for using XA. On Fri, Jul 3, 2009 at 16:14, Charles Moulliard wrote: > O

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Charles Moulliard
OK. I will change my config to use a separate TransactionManager for DB stuffs. My idea was to use the same transaction manager (JTA) in the application for JMS, DB, ... transactions but If this is not possible ... Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer **

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Claus Ibsen
On Fri, Jul 3, 2009 at 4:04 PM, Charles Moulliard wrote: > No. In the route presented here I don't make 2 independant DB calls. Only > one. The second bean called (generateError) only do a throw (without any > Hibernate/DB call) > > By the way, in the example > apache-camel-source\components\camel-

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Charles Moulliard
No. In the route presented here I don't make 2 independant DB calls. Only one. The second bean called (generateError) only do a throw (without any Hibernate/DB call) By the way, in the example apache-camel-source\components\camel-spring\src\test\java\org\apache\camel\spring\interceptor\Transaction

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Charles Moulliard
After verification, it appears that the message has not been redelivered. So, only one record is created in the DB. What I try to do is based on the camel test example : apache-camel-source\components\camel-spring\src\test\java\org\apache\camel\spring\interceptor\TransactionalClientDataSourceTest.

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Claus Ibsen
On Fri, Jul 3, 2009 at 3:52 PM, Guillaume Nodet wrote: > If the message is redelivered, this means there is a rollback. > I guess the problem is that your DB is not enlisted in the transaction. > However, if you don't want to use XA and two phase commit, you should > try to perform the database ste

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Guillaume Nodet
If the message is redelivered, this means there is a rollback. I guess the problem is that your DB is not enlisted in the transaction. However, if you don't want to use XA and two phase commit, you should try to perform the database step as late as possible so that there is very few chances that an

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Charles Moulliard
In debug we see more info : * 1) Creation has been initiated by TransactionManager* *15:31:52,484 | DEBUG | tenerContainer-2 | JtaTransactionManager | stractPlatformTransactionManager 371 | Creating new transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT* 15:31:52,531 | DEBUG | 9:

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Charles Moulliard
I have created a small route without JMS stuff. Here is the route : file OINP

Re: Transaction propagation between endpoints

2009-07-03 Thread Charles Moulliard
Where starts the transaction in a camel route or more precisely the begin/commit ? from(queueA) .transacted() // Transaction starts .to(bean:saveRequest) // Transaction propagated .to(bean:saveRequestMessage) // commit done .to(queueB) OR from(queueA) .transacted() // Transaction starts .t

Re: camel + service mix + spring aspect

2009-07-03 Thread Claus Ibsen
Hi What version of Camel are you using? There was an issue with 1.6.0 or older not being able to be IoC in some circumstances if the bean was a RouteBuilder instance. And thats the case with your route builder. However when using proxy it can be on interface or class level. And aspectj looks like

Re: Transaction propagation between endpoints

2009-07-03 Thread Claus Ibsen
On Fri, Jul 3, 2009 at 12:17 PM, Charles Moulliard wrote: > Hi, > > In Spring, it is possible to have one single transaction used between > several services calls (where Hibernate DAO are used by example). Here is a > small example and discussion about this subject on the web ( > http://forum.sprin

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Claus Ibsen
On Fri, Jul 3, 2009 at 12:16 PM, Guillaume Nodet wrote: > In this case, you should not use transactions for the DB at all, but > if any error occurs while saving the data, an exception should be > thrown and should rollback the transaction for the JMS layer. Yeah that would be perfect unless he doe

Transaction propagation between endpoints

2009-07-03 Thread Charles Moulliard
Hi, In Spring, it is possible to have one single transaction used between several services calls (where Hibernate DAO are used by example). Here is a small example and discussion about this subject on the web ( http://forum.springsource.org/showthread.php?t=73544) Is it possible in camel route th

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Guillaume Nodet
In this case, you should not use transactions for the DB at all, but if any error occurs while saving the data, an exception should be thrown and should rollback the transaction for the JMS layer. On Fri, Jul 3, 2009 at 10:48, Charles Moulliard wrote: > Claus, > > I don't want at all to use XA tra

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Charles Moulliard
Claus, I don't want at all to use XA transaction. Correct me if I'm wrong but the example of the documentation (Camel 2.0 - JMS Sample - part Spring XML) does not use at all a XA driver and the message will not be removed from the queue if a rollback occurs in the bean MyProcessor ? My concern is

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Claus Ibsen
And reconsider if you need XA at all. Its slow and hard to get setup. Try to let the DB be the last stuff you do and afterwards send the message to another queue for further processing in a 2nd route. If that is possible in your use-case. On Fri, Jul 3, 2009 at 10:25 AM, Claus Ibsen wrote: > Hi

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Claus Ibsen
Hi Get it working outside OSGi, eg in a small unit test thats easy to run and test from within your IDE. Google for JMS + hibernate + TX + XA to find some samples that work. And since you use JMS + DB in the same TX you need to use XA db driver. It can be a painful to get setup http://coffeedriv

Re: maxRedlivery and Transactional client does not work

2009-07-03 Thread Charles Moulliard
With this config in ActiveMq, it works and redelivery only one time the message : Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com On Fri, Jul 3, 20

Re: maxRedlivery and Transactional client does not work

2009-07-03 Thread Claus Ibsen
On Fri, Jul 3, 2009 at 10:13 AM, Charles Moulliard wrote: > That was my idea to configure it like that after reading the documentation > but the following example make me wrong You can mix and match Camel redelivery and TX manager redelivery. The sample below will use Camel redelivery up till 4 ti

Re: maxRedlivery and Transactional client does not work

2009-07-03 Thread Charles Moulliard
That was my idea to configure it like that after reading the documentation but the following example make me wrong JMSTransactionErrorHandlerTest.xml http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:camel="http://camel.apache

Re: Error using Transacted with Camel 2.0

2009-07-03 Thread Charles Moulliard
I'm still fighting against Spring config or Camel because Rollback does not occur. I have been able to configure Hibernate to use the same TransactionManager as the one used by JMS Here is the different part of the config. I don't know where the issue could be ! 1) ActiveMQ ...

Re: Camel Transaction and errorHandlerRef question

2009-07-03 Thread Claus Ibsen
On Fri, Jul 3, 2009 at 9:50 AM, Charles Moulliard wrote: > Hi, > > 1) Best place of  TransactionErrorHandlerBuilder > > I would like to know where is the bast place to put the reference of the > TransactionErrorHandlerBuilder in a transactional route ? At the level of > the route OR transacted ? >

Re: maxRedlivery and Transactional client does not work

2009-07-03 Thread Claus Ibsen
On Fri, Jul 3, 2009 at 9:53 AM, Charles Moulliard wrote: > Hi, > > I have configured my route like this but Camel continues to redeliver 6 > times the messages !!! Its the default redelivery by ActiveMQ you have to configure it how you want it to handle redelivery http://activemq.apache.org/redeli

maxRedlivery and Transactional client does not work

2009-07-03 Thread Charles Moulliard
Hi, I have configured my route like this but Camel continues to redeliver 6 times the messages !!! ** Regards,

Camel Transaction and errorHandlerRef question

2009-07-03 Thread Charles Moulliard
Hi, 1) Best place of TransactionErrorHandlerBuilder I would like to know where is the bast place to put the reference of the TransactionErrorHandlerBuilder in a transactional route ? At the level of the route OR transacted ? //

Re: tutorial-osgi-camel-part1

2009-07-03 Thread Charles Moulliard
Check also the log file to be sure that no errors are reported during launch of the bundles mentioned. Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com On Fri, Jul 3, 2009 at 4:21 AM, Willem Jiang