Re: Transacted routes without using spring route builder?

2013-11-06 Thread Willem jiang
Hi,
Camel transaction support is based on Spring transaction framework, even you 
are tend to use Java DSL.
We could let the Spring to load the Camel route which you defined in Java just 
like this[1]

[1]http://camel.apache.org/spring.html#Spring-UsingJavaCode  

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Wednesday, November 6, 2013 at 12:56 PM, kraythe . wrote:

> Greetings,
>  
> I have a route that needs to call a database, read some records, format
> them and put them into ActiveMQ. Naturally the best way to do this would be
> to wrap the whole thing in a transacted route. However, I do not want to
> use SpringXML as a route builder interface at all. I don't think its as
> expressive or flexible as the fluent builders.
>  
> The application will be running in a WAR in JBoss EAP 6.1.1 and using
> servletcontextlistener to bootstrap camel. Although I might have to
> tolerate some print intrusion I am generally not a fan of IOC spring taking
> over whole applications.
>  
> So what would be the best way to accomplish this?
>  
> *Robert Simmons Jr. MSc.*
> *Author of: Hardcore Java (2003) and Maintainable Java (2012)*
> *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
> *





Re: Transacted routes without using spring route builder?

2013-11-06 Thread Claus Ibsen
Servlet 3.0 has the @WebListener annotation you can use to bootstrap
your application.

And there is also this servlet listener from camel to bootstrap Camel
without spring
http://camel.apache.org/servletlistener-component.html

And an example using it
http://camel.apache.org/servlet-tomcat-no-spring-example.html



On Wed, Nov 6, 2013 at 5:56 AM, kraythe .  wrote:
> Greetings,
>
> I have a route that needs to call a database, read some records, format
> them and put them into ActiveMQ. Naturally the best way to do this would be
> to wrap the whole thing in a transacted route. However, I do not want to
> use SpringXML as a route builder interface at all. I don't think its as
> expressive or flexible as the fluent builders.
>
> The application will be running in a WAR in JBoss EAP 6.1.1 and using
> servletcontextlistener to bootstrap camel. Although I might have to
> tolerate some print intrusion I am generally not a fan of IOC spring taking
> over whole applications.
>
> So what would be the best way to accomplish this?
>
> *Robert Simmons Jr. MSc.*
> *Author of: Hardcore Java (2003) and Maintainable Java (2012)*
> *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
> *



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Transacted routes without using spring route builder?

2013-11-06 Thread kraythe .
I currently use the ServletListener to bootstrap things. What i want is the
ability to do transacted routes. Putting spring XML in scope in this
company won't happen as there are powers here with the ability to kill
spring usage and they don't like it. They don't mind if a component uses it
but they don't like it themselves.

So that brings us to the problem. Because of the as yet unreleased patch to
JNDI context (I can't use nightly pulls), I can't put the
PlatformTransactionManager in JNDI and look it up. ( see
http://camel.465427.n5.nabble.com/Proper-way-to-initialize-Transaction-management-for-Camel-in-an-Application-Server-td5739760.html).
I can create a SimpleRegistry and use that but I am wondering if I
loose
JNDI bound objects in the process. I currently run Camel inside JBoss EAP
6.1.1. I don't know if camel uses the server's InitialContext or creates
its own for the JNDI registry.

*Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
*Author of: Hardcore Java (2003) and Maintainable Java (2012)*
*LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
*


On Wed, Nov 6, 2013 at 2:27 AM, Claus Ibsen  wrote:

> Servlet 3.0 has the @WebListener annotation you can use to bootstrap
> your application.
>
> And there is also this servlet listener from camel to bootstrap Camel
> without spring
> http://camel.apache.org/servletlistener-component.html
>
> And an example using it
> http://camel.apache.org/servlet-tomcat-no-spring-example.html
>
>
>
> On Wed, Nov 6, 2013 at 5:56 AM, kraythe .  wrote:
> > Greetings,
> >
> > I have a route that needs to call a database, read some records, format
> > them and put them into ActiveMQ. Naturally the best way to do this would
> be
> > to wrap the whole thing in a transacted route. However, I do not want to
> > use SpringXML as a route builder interface at all. I don't think its as
> > expressive or flexible as the fluent builders.
> >
> > The application will be running in a WAR in JBoss EAP 6.1.1 and using
> > servletcontextlistener to bootstrap camel. Although I might have to
> > tolerate some print intrusion I am generally not a fan of IOC spring
> taking
> > over whole applications.
> >
> > So what would be the best way to accomplish this?
> >
> > *Robert Simmons Jr. MSc.*
> > *Author of: Hardcore Java (2003) and Maintainable Java (2012)*
> > *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
> > *
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>


Re: Transacted routes without using spring route builder?

2013-11-08 Thread Claus Ibsen
We have some JIRA tickets to introduce a transaction api in Camel, so
you can use that API instead of the Spring TX api. And therefore be
able to configure and setup TX with Camel without the Spring.

Though we haven't implemented that yet.



On Wed, Nov 6, 2013 at 5:11 PM, kraythe .  wrote:
> I currently use the ServletListener to bootstrap things. What i want is the
> ability to do transacted routes. Putting spring XML in scope in this
> company won't happen as there are powers here with the ability to kill
> spring usage and they don't like it. They don't mind if a component uses it
> but they don't like it themselves.
>
> So that brings us to the problem. Because of the as yet unreleased patch to
> JNDI context (I can't use nightly pulls), I can't put the
> PlatformTransactionManager in JNDI and look it up. ( see
> http://camel.465427.n5.nabble.com/Proper-way-to-initialize-Transaction-management-for-Camel-in-an-Application-Server-td5739760.html).
> I can create a SimpleRegistry and use that but I am wondering if I
> loose
> JNDI bound objects in the process. I currently run Camel inside JBoss EAP
> 6.1.1. I don't know if camel uses the server's InitialContext or creates
> its own for the JNDI registry.
>
> *Robert Simmons Jr. MSc. - Lead Java Architect @ EA*
> *Author of: Hardcore Java (2003) and Maintainable Java (2012)*
> *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
> *
>
>
> On Wed, Nov 6, 2013 at 2:27 AM, Claus Ibsen  wrote:
>
>> Servlet 3.0 has the @WebListener annotation you can use to bootstrap
>> your application.
>>
>> And there is also this servlet listener from camel to bootstrap Camel
>> without spring
>> http://camel.apache.org/servletlistener-component.html
>>
>> And an example using it
>> http://camel.apache.org/servlet-tomcat-no-spring-example.html
>>
>>
>>
>> On Wed, Nov 6, 2013 at 5:56 AM, kraythe .  wrote:
>> > Greetings,
>> >
>> > I have a route that needs to call a database, read some records, format
>> > them and put them into ActiveMQ. Naturally the best way to do this would
>> be
>> > to wrap the whole thing in a transacted route. However, I do not want to
>> > use SpringXML as a route builder interface at all. I don't think its as
>> > expressive or flexible as the fluent builders.
>> >
>> > The application will be running in a WAR in JBoss EAP 6.1.1 and using
>> > servletcontextlistener to bootstrap camel. Although I might have to
>> > tolerate some print intrusion I am generally not a fan of IOC spring
>> taking
>> > over whole applications.
>> >
>> > So what would be the best way to accomplish this?
>> >
>> > *Robert Simmons Jr. MSc.*
>> > *Author of: Hardcore Java (2003) and Maintainable Java (2012)*
>> > *LinkedIn: **http://www.linkedin.com/pub/robert-simmons/40/852/a39
>> > *
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> Red Hat, Inc.
>> Email: cib...@redhat.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen