Re: [DISCUSS] - Camel 2.0 - Easier Camel Spring Transaction configuration
Hi Okay last hurdle on this one. All wiki is done now, phew. See my comment on the JIRA ticket https://issues.apache.org/activemq/browse/CAMEL-1475 Its the one about the JMS stuff added on april-13. As I am in doubt whether the patch/idea is a good idea or not. Would love more feedback. On Tue, Apr 14, 2009 at 7:48 AM, Claus Ibsen wrote: >> >> Next step in improvement would be to handle that the >> PROPAGATION_REQUIRED bean is optional, so Camel can lookup and find >> the PlatformManager and default to required itself. Just like the JMS >> component can do with transacted=true URI option. > Okay I have added this feature now. > > Camel will auto lookup the PlatformTransactionManager and if it can > find a single bean in the registry it will use it. If there are 2 or > more it will thrown an exception so you can configure an explicit > policy defining which manager you want to use. > > This allows us to minimize the XML wiring, to what the Spring TX > itself requires = NO XML configuration for Camel is needed at all. > Just remember to set the route as transacted using that's it! > > > > -- > Claus Ibsen > Apache Camel Committer > > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > Apache Camel Reference Card: > http://refcardz.dzone.com/refcardz/enterprise-integration > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus Apache Camel Reference Card: http://refcardz.dzone.com/refcardz/enterprise-integration
Re: [DISCUSS] - Camel 2.0 - Easier Camel Spring Transaction configuration
> > Next step in improvement would be to handle that the > PROPAGATION_REQUIRED bean is optional, so Camel can lookup and find > the PlatformManager and default to required itself. Just like the JMS > component can do with transacted=true URI option. Okay I have added this feature now. Camel will auto lookup the PlatformTransactionManager and if it can find a single bean in the registry it will use it. If there are 2 or more it will thrown an exception so you can configure an explicit policy defining which manager you want to use. This allows us to minimize the XML wiring, to what the Spring TX itself requires = NO XML configuration for Camel is needed at all. Just remember to set the route as transacted using that's it! -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus Apache Camel Reference Card: http://refcardz.dzone.com/refcardz/enterprise-integration
Re: [DISCUSS] - Camel 2.0 - Easier Camel Spring Transaction configuration
Very cool. Nice work Claus! On Tue, Apr 7, 2009 at 4:57 AM, Claus Ibsen wrote: > Hi > > Latest progress now is that I have introduced the *transacted* DSL > keyword in both Java DSL and Spring DSL. > Its capable of auto lookup in the registry for the transaction policy > so no need to wire it. > > For instance in this Spring XML > > > > > >Tiger in Action > > > >Elephant in Action > > > > > The will look for beans of type > org.apache.camel.spi.TransactedPolicy that you define in the XML like > this > > > class="org.apache.camel.spring.spi.SpringTransactionPolicy"> > > > > And on top of that you dont have to setup the transacted error > handler, eg notice we dont have any errorHandlerRef in the route XML > at all. > > So what you only *must* do for defining a route as transacted is to > add the *transacted* DSL keyword. > > > Next step in improvement would be to handle that the > PROPAGATION_REQUIRED bean is optional, so Camel can lookup and find > the PlatformManager and default to required itself. Just like the JMS > component can do with transacted=true URI option. > > > > > > > > On Mon, Apr 6, 2009 at 1:56 PM, Claus Ibsen wrote: > > On Mon, Apr 6, 2009 at 10:12 AM, Claus Ibsen > wrote: > >> Hi > >> > >> Background is CAMEL-1475, however the ticket title is a bit misleading > >> > >> This morning I got Camel to be able to use transacted routes without > >> you have to remember to configure a transactedErrorHandler. > >> This makes it a bit easier to use transacted routes in Camel. > >> > >> So what you must do is use the *policy* DSL to define that this route > >> is transacted. > >> It still requires all the spring XML gobble to setup the TX manager > >> and all that verbose XML you cannot remember. > >> We can look at improving this later, want to keep the two of them > >> separated to not loose oversight. > >> > >> What I wants to discuss is that I think the *policy* DSL keyword is a > >> bit too loose. I would like it to be renamed to something that states > >> its transacted, eg > >> a) transacted > >> b) transaction > >> c) transactedPolicy > >> d) transactionPolicy > >> > >> As the JMS component have a special *transacted* URI option, I would > >> like the DSL to use same name as well. > >> So I am in favor of option A. > > I have worked a bit more on this. We keep the policy as is as it can > > be used for generic wrapping routes by an interceptor. > > We can use this for security stuff as well. > > > > I have instead added > > - transacted() > > - transacted(String ref) > > to the ProcessorDefinition so we in the Java DSL can indicate the > > route is transacted using a key word that states this than eg just > > policy. > > I am also working on being able to auto lookup the > > PROPAGATION_REQUIRED so you dont even have to specify a reference. > > Camel will > > just use the one found, if there are ONLY ONE TransactedPolicy bean > > defined in the registry. > > > > Next up is to be able to default to find the PlatformManager and just > > use a default REQUIRED policy so we dont even have to setup the > > PROPAGATION_REQUIRED bean in the XML. This will make it a bit easier > > to configure, then you just have to remember all the standard Spring > > TX XML stuff and then Camel can use it out of the box. Just you > > remember to add the *transacted* DSL in the route. > > > > PS: We could even consider adding a *transacted=true* pseudo URI > > option on DefaultComponent that will automatically added a > > *transacted* DSL to the route. Well just a whacky idea. > > > > > > > > > > > > > >> > >> CAMEL-1475 also hints some more improvements we can do with convention > >> over configuration, eg if there is only one SpringTransactionPolicy in > >> the XML then use that. > >> > >> > >> > >> -- > >> Claus Ibsen > >> Apache Camel Committer > >> > >> Open Source Integration: http://fusesource.com > >> Blog: http://davsclaus.blogspot.com/ > >> Twitter: http://twitter.com/davsclaus > >> Apache Camel Reference Card: > >> http://refcardz.dzone.com/refcardz/enterprise-integration > >> > > > > > > > > -- > > Claus Ibsen > > Apache Camel Committer > > > > Open Source Integration: http://fusesource.com > > Blog: http://davsclaus.blogspot.com/ > > Twitter: http://twitter.com/davsclaus > > Apache Camel Reference Card: > > http://refcardz.dzone.com/refcardz/enterprise-integration > > > > > > -- > Claus Ibsen > Apache Camel Committer > > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > Apache Camel Reference Card: > http://refcardz.dzone.com/refcardz/enterprise-integration > -- Cheers, Jon http://janstey.blogspot.com/
Re: [DISCUSS] - Camel 2.0 - Easier Camel Spring Transaction configuration
Hi Latest progress now is that I have introduced the *transacted* DSL keyword in both Java DSL and Spring DSL. Its capable of auto lookup in the registry for the transaction policy so no need to wire it. For instance in this Spring XML Tiger in Action Elephant in Action The will look for beans of type org.apache.camel.spi.TransactedPolicy that you define in the XML like this And on top of that you dont have to setup the transacted error handler, eg notice we dont have any errorHandlerRef in the route XML at all. So what you only *must* do for defining a route as transacted is to add the *transacted* DSL keyword. Next step in improvement would be to handle that the PROPAGATION_REQUIRED bean is optional, so Camel can lookup and find the PlatformManager and default to required itself. Just like the JMS component can do with transacted=true URI option. On Mon, Apr 6, 2009 at 1:56 PM, Claus Ibsen wrote: > On Mon, Apr 6, 2009 at 10:12 AM, Claus Ibsen wrote: >> Hi >> >> Background is CAMEL-1475, however the ticket title is a bit misleading >> >> This morning I got Camel to be able to use transacted routes without >> you have to remember to configure a transactedErrorHandler. >> This makes it a bit easier to use transacted routes in Camel. >> >> So what you must do is use the *policy* DSL to define that this route >> is transacted. >> It still requires all the spring XML gobble to setup the TX manager >> and all that verbose XML you cannot remember. >> We can look at improving this later, want to keep the two of them >> separated to not loose oversight. >> >> What I wants to discuss is that I think the *policy* DSL keyword is a >> bit too loose. I would like it to be renamed to something that states >> its transacted, eg >> a) transacted >> b) transaction >> c) transactedPolicy >> d) transactionPolicy >> >> As the JMS component have a special *transacted* URI option, I would >> like the DSL to use same name as well. >> So I am in favor of option A. > I have worked a bit more on this. We keep the policy as is as it can > be used for generic wrapping routes by an interceptor. > We can use this for security stuff as well. > > I have instead added > - transacted() > - transacted(String ref) > to the ProcessorDefinition so we in the Java DSL can indicate the > route is transacted using a key word that states this than eg just > policy. > I am also working on being able to auto lookup the > PROPAGATION_REQUIRED so you dont even have to specify a reference. > Camel will > just use the one found, if there are ONLY ONE TransactedPolicy bean > defined in the registry. > > Next up is to be able to default to find the PlatformManager and just > use a default REQUIRED policy so we dont even have to setup the > PROPAGATION_REQUIRED bean in the XML. This will make it a bit easier > to configure, then you just have to remember all the standard Spring > TX XML stuff and then Camel can use it out of the box. Just you > remember to add the *transacted* DSL in the route. > > PS: We could even consider adding a *transacted=true* pseudo URI > option on DefaultComponent that will automatically added a > *transacted* DSL to the route. Well just a whacky idea. > > > > > > >> >> CAMEL-1475 also hints some more improvements we can do with convention >> over configuration, eg if there is only one SpringTransactionPolicy in >> the XML then use that. >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> Apache Camel Reference Card: >> http://refcardz.dzone.com/refcardz/enterprise-integration >> > > > > -- > Claus Ibsen > Apache Camel Committer > > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > Apache Camel Reference Card: > http://refcardz.dzone.com/refcardz/enterprise-integration > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus Apache Camel Reference Card: http://refcardz.dzone.com/refcardz/enterprise-integration
Re: [DISCUSS] - Camel 2.0 - Easier Camel Spring Transaction configuration
On Mon, Apr 6, 2009 at 10:12 AM, Claus Ibsen wrote: > Hi > > Background is CAMEL-1475, however the ticket title is a bit misleading > > This morning I got Camel to be able to use transacted routes without > you have to remember to configure a transactedErrorHandler. > This makes it a bit easier to use transacted routes in Camel. > > So what you must do is use the *policy* DSL to define that this route > is transacted. > It still requires all the spring XML gobble to setup the TX manager > and all that verbose XML you cannot remember. > We can look at improving this later, want to keep the two of them > separated to not loose oversight. > > What I wants to discuss is that I think the *policy* DSL keyword is a > bit too loose. I would like it to be renamed to something that states > its transacted, eg > a) transacted > b) transaction > c) transactedPolicy > d) transactionPolicy > > As the JMS component have a special *transacted* URI option, I would > like the DSL to use same name as well. > So I am in favor of option A. I have worked a bit more on this. We keep the policy as is as it can be used for generic wrapping routes by an interceptor. We can use this for security stuff as well. I have instead added - transacted() - transacted(String ref) to the ProcessorDefinition so we in the Java DSL can indicate the route is transacted using a key word that states this than eg just policy. I am also working on being able to auto lookup the PROPAGATION_REQUIRED so you dont even have to specify a reference. Camel will just use the one found, if there are ONLY ONE TransactedPolicy bean defined in the registry. Next up is to be able to default to find the PlatformManager and just use a default REQUIRED policy so we dont even have to setup the PROPAGATION_REQUIRED bean in the XML. This will make it a bit easier to configure, then you just have to remember all the standard Spring TX XML stuff and then Camel can use it out of the box. Just you remember to add the *transacted* DSL in the route. PS: We could even consider adding a *transacted=true* pseudo URI option on DefaultComponent that will automatically added a *transacted* DSL to the route. Well just a whacky idea. > > CAMEL-1475 also hints some more improvements we can do with convention > over configuration, eg if there is only one SpringTransactionPolicy in > the XML then use that. > > > > -- > Claus Ibsen > Apache Camel Committer > > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > Apache Camel Reference Card: > http://refcardz.dzone.com/refcardz/enterprise-integration > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus Apache Camel Reference Card: http://refcardz.dzone.com/refcardz/enterprise-integration
[DISCUSS] - Camel 2.0 - Easier Camel Spring Transaction configuration
Hi Background is CAMEL-1475, however the ticket title is a bit misleading This morning I got Camel to be able to use transacted routes without you have to remember to configure a transactedErrorHandler. This makes it a bit easier to use transacted routes in Camel. So what you must do is use the *policy* DSL to define that this route is transacted. It still requires all the spring XML gobble to setup the TX manager and all that verbose XML you cannot remember. We can look at improving this later, want to keep the two of them separated to not loose oversight. What I wants to discuss is that I think the *policy* DSL keyword is a bit too loose. I would like it to be renamed to something that states its transacted, eg a) transacted b) transaction c) transactedPolicy d) transactionPolicy As the JMS component have a special *transacted* URI option, I would like the DSL to use same name as well. So I am in favor of option A. CAMEL-1475 also hints some more improvements we can do with convention over configuration, eg if there is only one SpringTransactionPolicy in the XML then use that. -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus Apache Camel Reference Card: http://refcardz.dzone.com/refcardz/enterprise-integration