Re: difference on seda versus threads usage

2017-10-24 Thread Robson Vargas Farias
small correction on the bench code:




  


versus


  



2017-10-24 21:34 GMT-02:00 Robson Vargas Farias <
robsonvargasfar...@gmail.com>:

> I'm trying to figure out the real world usage on both asynchronous
> options... even trying to fit a way where I could mix ... but not sure
> whether this makes sense...
>
> so, the question is, what's the basic difference using one or another,
> like:
>
> 
> 
>   
> 
>
> versus
>
> 
>uri="seda:in=20"/>
> 
> 
>
>
>


difference on seda versus threads usage

2017-10-24 Thread Robson Vargas Farias
I'm trying to figure out the real world usage on both asynchronous
options... even trying to fit a way where I could mix ... but not sure
whether this makes sense...

so, the question is, what's the basic difference using one or another, like:



  


versus


  




Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0

2017-10-24 Thread Dicken George
yes it seems to be like a timing issue :)

but what i don't understand is, i thought putting my manual route start up
in afterapplicationstart should have resolved the problem. Seems like it
doesn't :)

On Tue, Oct 24, 2017 at 7:25 PM, Mark Nuttall  wrote:

> I don't know enough about the inner workings of Camel to tell you about the
> version issue.
> If i remember rightly, I've heard of or experience the same sort of thing
> when doing outside the box things, like this. It is really a timing issue,
> if i remember rightly.
>
>
>
> On Tue, Oct 24, 2017 at 1:18 PM, Dicken George 
> wrote:
>
> > so in the stack trace it talks about line 66 but when i debug i can see
> > that
> >
> >"camelContext.startRoute("salesforce-versions");"
> >
> > already in line 64 meaning the route is not started as the routeservices
> > object is empty (null).  Which thereby causes and expection at line 66
> > which is
> >
> >Endpoint ep = theRoute.getEndpoint();
> >
> > I am wondering if there any specific call which adds all routes to the
> > camelcontext differently in 2.19.x compared to 2.20.0 ?
> >
> >
> >
> > On Tue, Oct 24, 2017 at 7:13 PM, Mark Nuttall 
> wrote:
> >
> > > Oh. i missed the "complex use case". Of the code you provided, what is
> > line
> > > 66?
> > >
> > > On Tue, Oct 24, 2017 at 11:47 AM, Mark Nuttall 
> > > wrote:
> > >
> > > > Is there any reason you are not using the standard Spring Boot +
> Camel
> > > > mechanisms to create the context and routes. I don't readily see any
> in
> > > > your code.  Doing so might resolve the problem.  Let me know if you
> > need
> > > > help with that..
> > > >
> > > > Mark
> > > >
> > > > On Tue, Oct 24, 2017 at 9:36 AM, Dicken George <
> dickengeo...@gmail.com
> > >
> > > > wrote:
> > > >
> > > >> Dear Fellow Developers,
> > > >>
> > > >> Just recently, I tried to upgrade my camel-spring boot project form
> > > camel
> > > >> 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up
> > my
> > > >> application any more, and I get the following stack trace
> > > >>
> > > >> java.lang.NullPointerException
> > > >> at
> > > >> com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicati
> > > >> onStart(BeanConfiguration.java:66)
> > > >> at
> > > >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv
> > > >> ent(RoutesCollector.java:226)
> > > >> at
> > > >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv
> > > >> ent(RoutesCollector.java:54)
> > > >> at
> > > >> org.springframework.context.event.SimpleApplicationEventMult
> > > >> icaster.doInvokeListener(SimpleApplicationEventMulticas
> ter.java:172)
> > > >> at
> > > >> org.springframework.context.event.SimpleApplicationEventMult
> > > >> icaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
> > > >> at
> > > >> org.springframework.context.event.SimpleApplicationEventMult
> > > >> icaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
> > > >> at
> > > >> org.springframework.context.support.AbstractApplicationConte
> > > >> xt.publishEvent(AbstractApplicationContext.java:393)
> > > >> at
> > > >> org.springframework.context.support.AbstractApplicationConte
> > > >> xt.publishEvent(AbstractApplicationContext.java:347)
> > > >> at
> > > >> org.springframework.context.support.AbstractApplicationConte
> > > >> xt.finishRefresh(AbstractApplicationContext.java:883)
> > > >> at
> > > >> org.springframework.boot.context.embedded.EmbeddedWebApplica
> > > >> tionContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
> > > >> at
> > > >> org.springframework.context.support.AbstractApplicationConte
> > > >> xt.refresh(AbstractApplicationContext.java:546)
> > > >> at
> > > >> org.springframework.boot.context.embedded.EmbeddedWebApplica
> > > >> tionContext.refresh(EmbeddedWebApplicationContext.java:122)
> > > >> at
> > > >> org.springframework.boot.SpringApplication.refresh(SpringApp
> > > >> lication.java:693)
> > > >> at
> > > >> org.springframework.boot.SpringApplication.refreshContext(Sp
> > > >> ringApplication.java:360)
> > > >> at
> > > >> org.springframework.boot.SpringApplication.run(SpringApplica
> > > >> tion.java:303)
> > > >> at
> > > >> org.springframework.boot.SpringApplication.run(SpringApplica
> > > >> tion.java:1118)
> > > >> at
> > > >> org.springframework.boot.SpringApplication.run(SpringApplica
> > > >> tion.java:1107)
> > > >> at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12)
> > > >>
> > > >> Due to my complex use case, i would like to start one specific route
> > > >> manually and not use the autoconfiguration and autostart from
> > > >> camelcontext.
> > > >> I do this in my configuration class by over riding the before
> > > application
> > > >> start and after application start methods.
> > > >>
> > > >> @Configuration
> > > >> class BeanConfiguration implements CamelContextConfiguration {
> > > >> private static final Logger log =
> > > >> LoggerFactory.getLogger(BeanConfiguration.cl

Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0

2017-10-24 Thread Mark Nuttall
I don't know enough about the inner workings of Camel to tell you about the
version issue.
If i remember rightly, I've heard of or experience the same sort of thing
when doing outside the box things, like this. It is really a timing issue,
if i remember rightly.



On Tue, Oct 24, 2017 at 1:18 PM, Dicken George 
wrote:

> so in the stack trace it talks about line 66 but when i debug i can see
> that
>
>"camelContext.startRoute("salesforce-versions");"
>
> already in line 64 meaning the route is not started as the routeservices
> object is empty (null).  Which thereby causes and expection at line 66
> which is
>
>Endpoint ep = theRoute.getEndpoint();
>
> I am wondering if there any specific call which adds all routes to the
> camelcontext differently in 2.19.x compared to 2.20.0 ?
>
>
>
> On Tue, Oct 24, 2017 at 7:13 PM, Mark Nuttall  wrote:
>
> > Oh. i missed the "complex use case". Of the code you provided, what is
> line
> > 66?
> >
> > On Tue, Oct 24, 2017 at 11:47 AM, Mark Nuttall 
> > wrote:
> >
> > > Is there any reason you are not using the standard Spring Boot + Camel
> > > mechanisms to create the context and routes. I don't readily see any in
> > > your code.  Doing so might resolve the problem.  Let me know if you
> need
> > > help with that..
> > >
> > > Mark
> > >
> > > On Tue, Oct 24, 2017 at 9:36 AM, Dicken George  >
> > > wrote:
> > >
> > >> Dear Fellow Developers,
> > >>
> > >> Just recently, I tried to upgrade my camel-spring boot project form
> > camel
> > >> 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up
> my
> > >> application any more, and I get the following stack trace
> > >>
> > >> java.lang.NullPointerException
> > >> at
> > >> com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicati
> > >> onStart(BeanConfiguration.java:66)
> > >> at
> > >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv
> > >> ent(RoutesCollector.java:226)
> > >> at
> > >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv
> > >> ent(RoutesCollector.java:54)
> > >> at
> > >> org.springframework.context.event.SimpleApplicationEventMult
> > >> icaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
> > >> at
> > >> org.springframework.context.event.SimpleApplicationEventMult
> > >> icaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
> > >> at
> > >> org.springframework.context.event.SimpleApplicationEventMult
> > >> icaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
> > >> at
> > >> org.springframework.context.support.AbstractApplicationConte
> > >> xt.publishEvent(AbstractApplicationContext.java:393)
> > >> at
> > >> org.springframework.context.support.AbstractApplicationConte
> > >> xt.publishEvent(AbstractApplicationContext.java:347)
> > >> at
> > >> org.springframework.context.support.AbstractApplicationConte
> > >> xt.finishRefresh(AbstractApplicationContext.java:883)
> > >> at
> > >> org.springframework.boot.context.embedded.EmbeddedWebApplica
> > >> tionContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
> > >> at
> > >> org.springframework.context.support.AbstractApplicationConte
> > >> xt.refresh(AbstractApplicationContext.java:546)
> > >> at
> > >> org.springframework.boot.context.embedded.EmbeddedWebApplica
> > >> tionContext.refresh(EmbeddedWebApplicationContext.java:122)
> > >> at
> > >> org.springframework.boot.SpringApplication.refresh(SpringApp
> > >> lication.java:693)
> > >> at
> > >> org.springframework.boot.SpringApplication.refreshContext(Sp
> > >> ringApplication.java:360)
> > >> at
> > >> org.springframework.boot.SpringApplication.run(SpringApplica
> > >> tion.java:303)
> > >> at
> > >> org.springframework.boot.SpringApplication.run(SpringApplica
> > >> tion.java:1118)
> > >> at
> > >> org.springframework.boot.SpringApplication.run(SpringApplica
> > >> tion.java:1107)
> > >> at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12)
> > >>
> > >> Due to my complex use case, i would like to start one specific route
> > >> manually and not use the autoconfiguration and autostart from
> > >> camelcontext.
> > >> I do this in my configuration class by over riding the before
> > application
> > >> start and after application start methods.
> > >>
> > >> @Configuration
> > >> class BeanConfiguration implements CamelContextConfiguration {
> > >> private static final Logger log =
> > >> LoggerFactory.getLogger(BeanConfiguration.class);
> > >>
> > >> @Override
> > >> public void beforeApplicationStart(CamelContext camelContext) {
> > >> camelContext.setPackageScanClassResolver(new
> > >> FatJarPackageScanClassResolver());
> > >> camelContext.resolveDataFormat("json-jackson");
> > >> }
> > >>
> > >> @Autowired
> > >> SalesforceComponent sfdcComp;
> > >>
> > >> @Override
> > >> public void afterApplicationStart(CamelContext camelContext) {
> > >>
> > >> try {
> > >> sfdcComp.start();
> > >>   

Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0

2017-10-24 Thread Dicken George
so in the stack trace it talks about line 66 but when i debug i can see
that

   "camelContext.startRoute("salesforce-versions");"

already in line 64 meaning the route is not started as the routeservices
object is empty (null).  Which thereby causes and expection at line 66
which is

   Endpoint ep = theRoute.getEndpoint();

I am wondering if there any specific call which adds all routes to the
camelcontext differently in 2.19.x compared to 2.20.0 ?



On Tue, Oct 24, 2017 at 7:13 PM, Mark Nuttall  wrote:

> Oh. i missed the "complex use case". Of the code you provided, what is line
> 66?
>
> On Tue, Oct 24, 2017 at 11:47 AM, Mark Nuttall 
> wrote:
>
> > Is there any reason you are not using the standard Spring Boot + Camel
> > mechanisms to create the context and routes. I don't readily see any in
> > your code.  Doing so might resolve the problem.  Let me know if you need
> > help with that..
> >
> > Mark
> >
> > On Tue, Oct 24, 2017 at 9:36 AM, Dicken George 
> > wrote:
> >
> >> Dear Fellow Developers,
> >>
> >> Just recently, I tried to upgrade my camel-spring boot project form
> camel
> >> 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my
> >> application any more, and I get the following stack trace
> >>
> >> java.lang.NullPointerException
> >> at
> >> com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicati
> >> onStart(BeanConfiguration.java:66)
> >> at
> >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv
> >> ent(RoutesCollector.java:226)
> >> at
> >> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv
> >> ent(RoutesCollector.java:54)
> >> at
> >> org.springframework.context.event.SimpleApplicationEventMult
> >> icaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
> >> at
> >> org.springframework.context.event.SimpleApplicationEventMult
> >> icaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
> >> at
> >> org.springframework.context.event.SimpleApplicationEventMult
> >> icaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
> >> at
> >> org.springframework.context.support.AbstractApplicationConte
> >> xt.publishEvent(AbstractApplicationContext.java:393)
> >> at
> >> org.springframework.context.support.AbstractApplicationConte
> >> xt.publishEvent(AbstractApplicationContext.java:347)
> >> at
> >> org.springframework.context.support.AbstractApplicationConte
> >> xt.finishRefresh(AbstractApplicationContext.java:883)
> >> at
> >> org.springframework.boot.context.embedded.EmbeddedWebApplica
> >> tionContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
> >> at
> >> org.springframework.context.support.AbstractApplicationConte
> >> xt.refresh(AbstractApplicationContext.java:546)
> >> at
> >> org.springframework.boot.context.embedded.EmbeddedWebApplica
> >> tionContext.refresh(EmbeddedWebApplicationContext.java:122)
> >> at
> >> org.springframework.boot.SpringApplication.refresh(SpringApp
> >> lication.java:693)
> >> at
> >> org.springframework.boot.SpringApplication.refreshContext(Sp
> >> ringApplication.java:360)
> >> at
> >> org.springframework.boot.SpringApplication.run(SpringApplica
> >> tion.java:303)
> >> at
> >> org.springframework.boot.SpringApplication.run(SpringApplica
> >> tion.java:1118)
> >> at
> >> org.springframework.boot.SpringApplication.run(SpringApplica
> >> tion.java:1107)
> >> at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12)
> >>
> >> Due to my complex use case, i would like to start one specific route
> >> manually and not use the autoconfiguration and autostart from
> >> camelcontext.
> >> I do this in my configuration class by over riding the before
> application
> >> start and after application start methods.
> >>
> >> @Configuration
> >> class BeanConfiguration implements CamelContextConfiguration {
> >> private static final Logger log =
> >> LoggerFactory.getLogger(BeanConfiguration.class);
> >>
> >> @Override
> >> public void beforeApplicationStart(CamelContext camelContext) {
> >> camelContext.setPackageScanClassResolver(new
> >> FatJarPackageScanClassResolver());
> >> camelContext.resolveDataFormat("json-jackson");
> >> }
> >>
> >> @Autowired
> >> SalesforceComponent sfdcComp;
> >>
> >> @Override
> >> public void afterApplicationStart(CamelContext camelContext) {
> >>
> >> try {
> >> sfdcComp.start();
> >> camelContext.startRoute("salesforce-versions");
> >> Route theRoute = camelContext.getRoute("salesfo
> >> rce-versions");
> >> Endpoint ep = theRoute.getEndpoint();
> >>
> >> Exchange exchange = ep.createExchange();
> >> ProducerTemplate template =
> >> exchange.getContext().createProducerTemplate();
> >> DefaultExchange o = (DefaultExchange) template.request(ep,
> new
> >> Processor() {
> >>
> >> @Override
> >> public void process(Exchange exchange) throws Exce

Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0

2017-10-24 Thread Dicken George
Hi Mark,

Thank you for your reply.

I use the manual method to start one specific route as I would like to
control the application behaviour. It is kind of a exception handler that
allows me to shutdown my application incase the route was not successfully
able to get the salesforce version.

Therefore i want to control is manually after the camel context is all
started up.

On Tue, Oct 24, 2017 at 5:47 PM, Mark Nuttall  wrote:

> Is there any reason you are not using the standard Spring Boot + Camel
> mechanisms to create the context and routes. I don't readily see any in
> your code.  Doing so might resolve the problem.  Let me know if you need
> help with that..
>
> Mark
>
> On Tue, Oct 24, 2017 at 9:36 AM, Dicken George 
> wrote:
>
> > Dear Fellow Developers,
> >
> > Just recently, I tried to upgrade my camel-spring boot project form camel
> > 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my
> > application any more, and I get the following stack trace
> >
> > java.lang.NullPointerException
> > at
> > com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicationStart(
> > BeanConfiguration.java:66)
> > at
> > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(
> > RoutesCollector.java:226)
> > at
> > org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(
> > RoutesCollector.java:54)
> > at
> > org.springframework.context.event.SimpleApplicationEventMulticas
> > ter.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
> > at
> > org.springframework.context.event.SimpleApplicationEventMulticas
> > ter.invokeListener(SimpleApplicationEventMulticaster.java:165)
> > at
> > org.springframework.context.event.SimpleApplicationEventMulticas
> > ter.multicastEvent(SimpleApplicationEventMulticaster.java:139)
> > at
> > org.springframework.context.support.AbstractApplicationContext.
> > publishEvent(AbstractApplicationContext.java:393)
> > at
> > org.springframework.context.support.AbstractApplicationContext.
> > publishEvent(AbstractApplicationContext.java:347)
> > at
> > org.springframework.context.support.AbstractApplicationContext.
> > finishRefresh(AbstractApplicationContext.java:883)
> > at
> > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.
> > finishRefresh(EmbeddedWebApplicationContext.java:144)
> > at
> > org.springframework.context.support.AbstractApplicationContext.refresh(
> > AbstractApplicationContext.java:546)
> > at
> > org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.
> > refresh(EmbeddedWebApplicationContext.java:122)
> > at
> > org.springframework.boot.SpringApplication.refresh(
> > SpringApplication.java:693)
> > at
> > org.springframework.boot.SpringApplication.refreshContext(
> > SpringApplication.java:360)
> > at
> > org.springframework.boot.SpringApplication.run(
> SpringApplication.java:303)
> > at
> > org.springframework.boot.SpringApplication.run(
> > SpringApplication.java:1118)
> > at
> > org.springframework.boot.SpringApplication.run(
> > SpringApplication.java:1107)
> > at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12)
> >
> > Due to my complex use case, i would like to start one specific route
> > manually and not use the autoconfiguration and autostart from
> camelcontext.
> > I do this in my configuration class by over riding the before application
> > start and after application start methods.
> >
> > @Configuration
> > class BeanConfiguration implements CamelContextConfiguration {
> > private static final Logger log =
> > LoggerFactory.getLogger(BeanConfiguration.class);
> >
> > @Override
> > public void beforeApplicationStart(CamelContext camelContext) {
> > camelContext.setPackageScanClassResolver(new
> > FatJarPackageScanClassResolver());
> > camelContext.resolveDataFormat("json-jackson");
> > }
> >
> > @Autowired
> > SalesforceComponent sfdcComp;
> >
> > @Override
> > public void afterApplicationStart(CamelContext camelContext) {
> >
> > try {
> > sfdcComp.start();
> > camelContext.startRoute("salesforce-versions");
> > Route theRoute = camelContext.getRoute("
> salesforce-versions");
> > Endpoint ep = theRoute.getEndpoint();
> >
> > Exchange exchange = ep.createExchange();
> > ProducerTemplate template =
> > exchange.getContext().createProducerTemplate();
> > DefaultExchange o = (DefaultExchange) template.request(ep,
> new
> > Processor() {
> >
> > @Override
> > public void process(Exchange exchange) throws Exception {
> > // TODO Auto-generated method stub
> >
> > }
> > });
> > Object result = o.getOut().getBody();
> > if(result == null && !(result instanceof ArrayList))
> > throw new Exception("No Salesforce version, login
> > failed.");
> >
> > ArrayList theList = (ArrayList) result;

Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0

2017-10-24 Thread Mark Nuttall
Oh. i missed the "complex use case". Of the code you provided, what is line
66?

On Tue, Oct 24, 2017 at 11:47 AM, Mark Nuttall  wrote:

> Is there any reason you are not using the standard Spring Boot + Camel
> mechanisms to create the context and routes. I don't readily see any in
> your code.  Doing so might resolve the problem.  Let me know if you need
> help with that..
>
> Mark
>
> On Tue, Oct 24, 2017 at 9:36 AM, Dicken George 
> wrote:
>
>> Dear Fellow Developers,
>>
>> Just recently, I tried to upgrade my camel-spring boot project form camel
>> 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my
>> application any more, and I get the following stack trace
>>
>> java.lang.NullPointerException
>> at
>> com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicati
>> onStart(BeanConfiguration.java:66)
>> at
>> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv
>> ent(RoutesCollector.java:226)
>> at
>> org.apache.camel.spring.boot.RoutesCollector.onApplicationEv
>> ent(RoutesCollector.java:54)
>> at
>> org.springframework.context.event.SimpleApplicationEventMult
>> icaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
>> at
>> org.springframework.context.event.SimpleApplicationEventMult
>> icaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
>> at
>> org.springframework.context.event.SimpleApplicationEventMult
>> icaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
>> at
>> org.springframework.context.support.AbstractApplicationConte
>> xt.publishEvent(AbstractApplicationContext.java:393)
>> at
>> org.springframework.context.support.AbstractApplicationConte
>> xt.publishEvent(AbstractApplicationContext.java:347)
>> at
>> org.springframework.context.support.AbstractApplicationConte
>> xt.finishRefresh(AbstractApplicationContext.java:883)
>> at
>> org.springframework.boot.context.embedded.EmbeddedWebApplica
>> tionContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
>> at
>> org.springframework.context.support.AbstractApplicationConte
>> xt.refresh(AbstractApplicationContext.java:546)
>> at
>> org.springframework.boot.context.embedded.EmbeddedWebApplica
>> tionContext.refresh(EmbeddedWebApplicationContext.java:122)
>> at
>> org.springframework.boot.SpringApplication.refresh(SpringApp
>> lication.java:693)
>> at
>> org.springframework.boot.SpringApplication.refreshContext(Sp
>> ringApplication.java:360)
>> at
>> org.springframework.boot.SpringApplication.run(SpringApplica
>> tion.java:303)
>> at
>> org.springframework.boot.SpringApplication.run(SpringApplica
>> tion.java:1118)
>> at
>> org.springframework.boot.SpringApplication.run(SpringApplica
>> tion.java:1107)
>> at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12)
>>
>> Due to my complex use case, i would like to start one specific route
>> manually and not use the autoconfiguration and autostart from
>> camelcontext.
>> I do this in my configuration class by over riding the before application
>> start and after application start methods.
>>
>> @Configuration
>> class BeanConfiguration implements CamelContextConfiguration {
>> private static final Logger log =
>> LoggerFactory.getLogger(BeanConfiguration.class);
>>
>> @Override
>> public void beforeApplicationStart(CamelContext camelContext) {
>> camelContext.setPackageScanClassResolver(new
>> FatJarPackageScanClassResolver());
>> camelContext.resolveDataFormat("json-jackson");
>> }
>>
>> @Autowired
>> SalesforceComponent sfdcComp;
>>
>> @Override
>> public void afterApplicationStart(CamelContext camelContext) {
>>
>> try {
>> sfdcComp.start();
>> camelContext.startRoute("salesforce-versions");
>> Route theRoute = camelContext.getRoute("salesfo
>> rce-versions");
>> Endpoint ep = theRoute.getEndpoint();
>>
>> Exchange exchange = ep.createExchange();
>> ProducerTemplate template =
>> exchange.getContext().createProducerTemplate();
>> DefaultExchange o = (DefaultExchange) template.request(ep, new
>> Processor() {
>>
>> @Override
>> public void process(Exchange exchange) throws Exception {
>> // TODO Auto-generated method stub
>>
>> }
>> });
>> Object result = o.getOut().getBody();
>> if(result == null && !(result instanceof ArrayList))
>> throw new Exception("No Salesforce version, login
>> failed.");
>>
>> ArrayList theList = (ArrayList) result;
>> if(theList.size() <= 1)
>> throw new Exception("No Salesforce version got, login
>> failed.");
>> log.debug("Connection to salesforce successfully
>> established:");
>>
>> } catch (Exception e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>> throw new RuntimeException("No Connection to sal

Re: Problem with upgrade from camel 2.19.3 to camel 2.20.0

2017-10-24 Thread Mark Nuttall
Is there any reason you are not using the standard Spring Boot + Camel
mechanisms to create the context and routes. I don't readily see any in
your code.  Doing so might resolve the problem.  Let me know if you need
help with that..

Mark

On Tue, Oct 24, 2017 at 9:36 AM, Dicken George 
wrote:

> Dear Fellow Developers,
>
> Just recently, I tried to upgrade my camel-spring boot project form camel
> 2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my
> application any more, and I get the following stack trace
>
> java.lang.NullPointerException
> at
> com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicationStart(
> BeanConfiguration.java:66)
> at
> org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(
> RoutesCollector.java:226)
> at
> org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(
> RoutesCollector.java:54)
> at
> org.springframework.context.event.SimpleApplicationEventMulticas
> ter.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
> at
> org.springframework.context.event.SimpleApplicationEventMulticas
> ter.invokeListener(SimpleApplicationEventMulticaster.java:165)
> at
> org.springframework.context.event.SimpleApplicationEventMulticas
> ter.multicastEvent(SimpleApplicationEventMulticaster.java:139)
> at
> org.springframework.context.support.AbstractApplicationContext.
> publishEvent(AbstractApplicationContext.java:393)
> at
> org.springframework.context.support.AbstractApplicationContext.
> publishEvent(AbstractApplicationContext.java:347)
> at
> org.springframework.context.support.AbstractApplicationContext.
> finishRefresh(AbstractApplicationContext.java:883)
> at
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.
> finishRefresh(EmbeddedWebApplicationContext.java:144)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(
> AbstractApplicationContext.java:546)
> at
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.
> refresh(EmbeddedWebApplicationContext.java:122)
> at
> org.springframework.boot.SpringApplication.refresh(
> SpringApplication.java:693)
> at
> org.springframework.boot.SpringApplication.refreshContext(
> SpringApplication.java:360)
> at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
> at
> org.springframework.boot.SpringApplication.run(
> SpringApplication.java:1118)
> at
> org.springframework.boot.SpringApplication.run(
> SpringApplication.java:1107)
> at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12)
>
> Due to my complex use case, i would like to start one specific route
> manually and not use the autoconfiguration and autostart from camelcontext.
> I do this in my configuration class by over riding the before application
> start and after application start methods.
>
> @Configuration
> class BeanConfiguration implements CamelContextConfiguration {
> private static final Logger log =
> LoggerFactory.getLogger(BeanConfiguration.class);
>
> @Override
> public void beforeApplicationStart(CamelContext camelContext) {
> camelContext.setPackageScanClassResolver(new
> FatJarPackageScanClassResolver());
> camelContext.resolveDataFormat("json-jackson");
> }
>
> @Autowired
> SalesforceComponent sfdcComp;
>
> @Override
> public void afterApplicationStart(CamelContext camelContext) {
>
> try {
> sfdcComp.start();
> camelContext.startRoute("salesforce-versions");
> Route theRoute = camelContext.getRoute("salesforce-versions");
> Endpoint ep = theRoute.getEndpoint();
>
> Exchange exchange = ep.createExchange();
> ProducerTemplate template =
> exchange.getContext().createProducerTemplate();
> DefaultExchange o = (DefaultExchange) template.request(ep, new
> Processor() {
>
> @Override
> public void process(Exchange exchange) throws Exception {
> // TODO Auto-generated method stub
>
> }
> });
> Object result = o.getOut().getBody();
> if(result == null && !(result instanceof ArrayList))
> throw new Exception("No Salesforce version, login
> failed.");
>
> ArrayList theList = (ArrayList) result;
> if(theList.size() <= 1)
> throw new Exception("No Salesforce version got, login
> failed.");
> log.debug("Connection to salesforce successfully
> established:");
>
> } catch (Exception e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> throw new RuntimeException("No Connection to salesforce");
> }
>
> }
> In this code, i saw during my debugging that it was able to start the
> routes in camelcontext object and get the endpoints, however with version
> 2.20.0 I see my routes are not added to the camelcontext and no routes are
> started.
>
> Could an

Problem with upgrade from camel 2.19.3 to camel 2.20.0

2017-10-24 Thread Dicken George
Dear Fellow Developers,

Just recently, I tried to upgrade my camel-spring boot project form camel
2.19.3 to camel 2.20.0 and I face the problem that, I cannot boot up my
application any more, and I get the following stack trace

java.lang.NullPointerException
at
com.haufe.ssmp.sfdc.api.app.BeanConfiguration.afterApplicationStart(BeanConfiguration.java:66)
at
org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:226)
at
org.apache.camel.spring.boot.RoutesCollector.onApplicationEvent(RoutesCollector.java:54)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.haufe.ssmp.sfdc.api.Application.main(Application.java:12)

Due to my complex use case, i would like to start one specific route
manually and not use the autoconfiguration and autostart from camelcontext.
I do this in my configuration class by over riding the before application
start and after application start methods.

@Configuration
class BeanConfiguration implements CamelContextConfiguration {
private static final Logger log =
LoggerFactory.getLogger(BeanConfiguration.class);

@Override
public void beforeApplicationStart(CamelContext camelContext) {
camelContext.setPackageScanClassResolver(new
FatJarPackageScanClassResolver());
camelContext.resolveDataFormat("json-jackson");
}

@Autowired
SalesforceComponent sfdcComp;

@Override
public void afterApplicationStart(CamelContext camelContext) {

try {
sfdcComp.start();
camelContext.startRoute("salesforce-versions");
Route theRoute = camelContext.getRoute("salesforce-versions");
Endpoint ep = theRoute.getEndpoint();

Exchange exchange = ep.createExchange();
ProducerTemplate template =
exchange.getContext().createProducerTemplate();
DefaultExchange o = (DefaultExchange) template.request(ep, new
Processor() {

@Override
public void process(Exchange exchange) throws Exception {
// TODO Auto-generated method stub

}
});
Object result = o.getOut().getBody();
if(result == null && !(result instanceof ArrayList))
throw new Exception("No Salesforce version, login
failed.");

ArrayList theList = (ArrayList) result;
if(theList.size() <= 1)
throw new Exception("No Salesforce version got, login
failed.");
log.debug("Connection to salesforce successfully established:");

} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new RuntimeException("No Connection to salesforce");
}

}
In this code, i saw during my debugging that it was able to start the
routes in camelcontext object and get the endpoints, however with version
2.20.0 I see my routes are not added to the camelcontext and no routes are
started.

Could anyone help me here to trouble shoot this issue ?

Thanks in advance
-- 

Dicken George


CamelSpringBootRunner and AdviceWith

2017-10-24 Thread Boris Stanojević
When using CamelSpringBootRunner (camel 2.20) for my tests I'm not able to
"adviceWith" my Routes any more since CamelContext is already started by "
CamelSpringBootExecutionListener" and therefore adviceWith doesn't take
place.

Any suggestions?

Many thanks!!


Camel FTP producer writing file without listing

2017-10-24 Thread Laurentiu Trica
Hello,

I have to write files in a FTP folder that contains thousands of files.
Seems that the FTP producer always does a list before writing the file.

I use Camel 2.13

Is there a way to avoid getting the files list? It's very time consuming
and it often makes the write to fail...
I've been trying setting all the possible options to avoid the listing
without success so far.

Thanks!
Laurentiu


Re: camel-jetty and jetty version 9.4.7.v20170914

2017-10-24 Thread Claus Ibsen
You can use camel-servlet instead, which would be better as you are
using the servlet engine from spring boot.

On Tue, Oct 24, 2017 at 1:51 PM, Greg Ludington  wrote:
> My apologies; I am talking about consumers, not producers.
>
> Sent from my iPhone
>
>> On Oct 23, 2017, at 11:12 PM, Claus Ibsen  wrote:
>>
>> Hi
>>
>> Jetty producer (not the consumer) is deprecated, do not use that, and
>> migrate to use something else.
>>
>>> On Mon, Oct 23, 2017 at 11:21 PM, Greg Ludington  
>>> wrote:
>>> Camel jetty producer routes are not starting after updating to Spring Boot
>>> 1.5.8, which includes jetty version 9.4.7.v20170914
>>>
>>> To test:
>>> in master's camel-jetty pom.xml, set this line:
>>>
>>> 9.3.21.v20170918
>>> to
>>> 9.4.7.v20170914
>>>
>>> and the context fails to initialize with
>>>
>>> org.apache.camel.RuntimeCamelException: java.lang.IllegalStateException:
>>> Locker is not reentrant
>>> Caused by: java.lang.IllegalStateException: Locker is not reentrant
>>>
>>> For other reasons, we have to use jetty 9.4.x in our application; version
>>> 9.4.6.v20170531, the version included in spring-boot 1.5.7 does work and
>>> functional normally.  Setting that jetty.version property in to that
>>> version does work.
>>>
>>> A commit last week,
>>> http://camel.465427.n5.nabble.com/camel-branch-master-updated-Upgrade-to-Spring-Boot-1-5-8-td5814662.html
>>> , updates to spring-boot 1.5.8 and jetty-version 9.4.7.v20170914, but I did
>>> not see that upon pulling from github.  Is this something that is already
>>> addressed in master, or should a ticket be filed?
>>>
>>> Thank you,
>>> Greg
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: camel-jetty and jetty version 9.4.7.v20170914

2017-10-24 Thread Greg Ludington
My apologies; I am talking about consumers, not producers.

Sent from my iPhone

> On Oct 23, 2017, at 11:12 PM, Claus Ibsen  wrote:
> 
> Hi
> 
> Jetty producer (not the consumer) is deprecated, do not use that, and
> migrate to use something else.
> 
>> On Mon, Oct 23, 2017 at 11:21 PM, Greg Ludington  
>> wrote:
>> Camel jetty producer routes are not starting after updating to Spring Boot
>> 1.5.8, which includes jetty version 9.4.7.v20170914
>> 
>> To test:
>> in master's camel-jetty pom.xml, set this line:
>> 
>> 9.3.21.v20170918
>> to
>> 9.4.7.v20170914
>> 
>> and the context fails to initialize with
>> 
>> org.apache.camel.RuntimeCamelException: java.lang.IllegalStateException:
>> Locker is not reentrant
>> Caused by: java.lang.IllegalStateException: Locker is not reentrant
>> 
>> For other reasons, we have to use jetty 9.4.x in our application; version
>> 9.4.6.v20170531, the version included in spring-boot 1.5.7 does work and
>> functional normally.  Setting that jetty.version property in to that
>> version does work.
>> 
>> A commit last week,
>> http://camel.465427.n5.nabble.com/camel-branch-master-updated-Upgrade-to-Spring-Boot-1-5-8-td5814662.html
>> , updates to spring-boot 1.5.8 and jetty-version 9.4.7.v20170914, but I did
>> not see that upon pulling from github.  Is this something that is already
>> addressed in master, or should a ticket be filed?
>> 
>> Thank you,
>> Greg
> 
> 
> 
> -- 
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: No host for http4 connection

2017-10-24 Thread Zoran Regvart
Hi Allen,
seems like the client did not set the `Host` HTTP header, not sure why
would that be as I think most HTTP clients set it by default,

zoran

[1] https://issues.apache.org/jira/browse/CAMEL-5757

On Fri, Oct 20, 2017 at 6:30 PM, Bagwell, Allen F  wrote:
> I am trying to write a test that needs to contact a RESTful service and get 
> back a reply in JSON. I wanted a lightweight HTTP client, so I opted to use 
> the
>
>
> Here is what my prep processor does:
>
> exchange.getIn().setHeader(Exchange.ACCEPT_CONTENT_TYPE, "application/json");
> exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "text/plain");
> exchange.getIn().setHeader(Exchange.HTTP_METHOD, POST);
> exchange.getIn().setBody("This is my test");
>
>
> Here is the route...
>
> 
>  
>  
>  
>  
>  
>  
> 
>
>
> Here's the  part of the log when the test starts to show I have a server set 
> up for the HTTP4 client to contact (it maps the "/contact" part of the URI in 
> a service bean):
>
> INFO: Setting the server's publish address to be 
> http://localhost:7000/cxf/rest
> INFO  20-Oct-2017 08:54:03.382, [main], Server - jetty-9.2.21.v20170120
> WARN  20-Oct-2017 08:54:03.410, [main], AbstractHandler - No Server set for 
> org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine$1@2ca6546f
> INFO  20-Oct-2017 08:54:03.415, [main], ServerConnector - Started 
> ServerConnector@73877e19{HTTP/1.1}{localhost:7000}
> INFO  20-Oct-2017 08:54:03.415, [main], Server - Started @10647ms
>
> Here is the log output from the moment the prepProcessor bean is invoked in 
> the test:
>
> DEBUG 20-Oct-2017 08:54:04.732, [Camel (test-context) thread #2 - 
> seda://input], PrepProcessor - {breadcrumbId=ID-arda-32947-1508514836918-0-6, 
> CamelAcceptContentType=application/json, CamelHttpMethod=POST, 
> Content-Type=text/plain}
> WARN  20-Oct-2017 08:54:04.980, [qtp632841653-70], HttpParser - badMessage: 
> 400 No Host for 
> HttpChannelOverHttp@47cfe850{r=0,c=false,a=IDLE,uri=/cxf/rest/contact}
>
> Can anyone spot what I'm doing wrong here? I followed the instructions off 
> the Camel-HTTP4 web page. It seemed pretty straight-forward, so I'm not 
> understanding why it can't find a host.
>
> Thanks!
> -Allen
>



-- 
Zoran Regvart


Re: Camel JPA + Wildfly Swarm

2017-10-24 Thread Zoran Regvart
Hi Renato,
this looks to me like your archive contains classes that are already
present on the servers classpath. Perhaps you can try comparing your
code with one of the examples from the wildfly-camel, there is a JPA
example in the GitHub repository[1], and one in the in the
wildfly-swarm[2] repository,

zoran

[1] 
https://github.com/wildfly-extras/wildfly-camel-examples/tree/master/camel-jpa
[2] 
https://github.com/wildfly-swarm/wildfly-swarm-examples/tree/master/camel/camel-jpa

On Sat, Oct 21, 2017 at 8:57 PM, Renato Barros  wrote:
> Hello,
>
> I'm trying to use Camel in Wildfly Swarm and i get the follow exception
> when use Camel JPA endpoint:
>
> java.lang.ClassCastException:
> com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple
> cannot be cast to javax.transaction.TransactionManager
>
>
> How can i configure the JTA in Swarm to be compatible with Camel JPA.


-- 
Zoran Regvart