[ANNOUNCEMENT] Apache Camel 2.20.0 Released

2017-10-11 Thread Gregor Zurowski
The Camel community announces the immediate availability of the new
minor release Camel 2.20.0. This release contains over 550 fixes and
improvements.

The artifacts are published and ready for you to download [2] either
from the Apache mirrors or from the Central Maven repository. For more
details please take a look at the release notes [1, 3].

Many thanks to all who made this release possible.

On behalf of the Camel PMC,
Gregor Zurowski

[1] http://camel.apache.org/camel-2200-release.html
[2] http://camel.apache.org/download.html
[3] 
https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12337871=12311211


Re: onCompletion doesn't get executed when onException handler is triggerred

2017-10-11 Thread LiQiang Ye
Claus, I found that the route that main route that contains multicast will
stop routing after "direct:a" hits exception handler. So I want to know how
I can make the route continue routing even if "direct:a" hits exception and
does its retries and stops.

from("timer:reload-config?delay=" + reloadInterval +
"=true=" + reloadInterval)
.multicast().parallelProcessing()
.to("direct:a", "direct:b")
.end()
.log("route is done")  // Note: it will never hit the log if "direct:a"
hits the exception handler.




On Tue, Oct 10, 2017 at 2:51 PM, LiQiang Ye  wrote:

> Hi camel friends
>
> I have routes designed as below. I wonder how I can make onCompletion()
> block to execute route "c" even though route "a" or route "b" has exception
> occurs. Currently when a processing route "a" or "b" encounters exception
> and retries, the route will stop routing further and onCompletion block
> never gets executed.
>
>
> from("timer:reload-config?delay=" + reloadInterval +
> "=true=" + reloadInterval)
> .multicast().parallelProcessing()
> .to("direct:a", "direct:b")
> .end()
> .onCompletion()
> .log("parallel processing is done").setBody(constant(null)).to("direct:c")
>
> --
>
> from("direct:a")
>   .onException(Exception.class)
> .maximumRedeliveries(3)
> .redeliveryDelay(1000)
> .backOffMultiplier(2)
> .retryAttemptedLogLevel(LoggingLevel.WARN)
> .handled(true)
>   .end()
>   .to("bean:aBean?method=setData")
>
> Thanks
>


another example walkthrough for Camel

2017-10-11 Thread Bill Durksen
This may not be the correct forum for this question but here goes.
I don't see the uri definitions or the source code for this walkthrough, found 
at url: http://camel.apache.org/walk-through-another-example.html.
Does anyone know why this happens or why Chrome complains with dialog: 
"camel.apache.org says: Syntax highlighter Can't find brush for: java"?
IE is not much better.



stop

2017-10-11 Thread Hetmoteus

stop plz



API Management Products Support in Apache Camel

2017-10-11 Thread Imran Raza Khan
Do Apache Camel support products like Red Hat 3Scale, Apigee or WSO2
Api Management?


Mysql-connector 8.0.8 not in maven, dependency error

2017-10-11 Thread Farkas Lajos

Hello Camel users,


i'm trying to install camel-ftp on karaf 4.0.4, and i'm getting this error:


2017-10-11 19:24:45,106 | WARN  | ool-379-thread-7 | 
AetherBasedResolver  | 5 - 
org.ops4j.pax.logging.pax-logging-api - 1.8.5 | Error resolving 
artifactmysql:mysql-connector-java:jar:8.0.8:Could not find artifact 
mysql:mysql-connector-java:jar:8.0.8 in central 
(http://repo1.maven.org/maven2/)
shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Could 
not find artifact mysql:mysql-connector-java:jar:8.0.8 in central 
(http://repo1.maven.org/maven2/)



in the maven repository, there is no 8.0.8 version for mysql connector, 
but for version 8.0.8-dmr.


Is there a way to install camel-ftp, without this dependency?

Thank you.





Re: Urgent: Camel Hystrix Java DSL Questions

2017-10-11 Thread LiQiang Ye
Thanks Claus!

Some follow ups on your answers:

1) I have been using camel 2.19.0. What version fixed the bug?

2) hystrix() has methods like getHystrixConfigurations(), is it usable in
route dsl? If yes, can you please provide a route DSL example?

3) Thanks for providing the feature in the new commit! I wonder when it
will be available and how to use it in route DSL. Can you please also
provide an example?


On Wed, Oct 11, 2017 at 6:26 AM, Claus Ibsen  wrote:

> Hi
>
> Okay I found out a bit and logged a ticket
> https://issues.apache.org/jira/browse/CAMEL-11895?
>
> You can see this commit that can get the CB state
> https://github.com/apache/camel/commit/ebf7b80c23006551f44000befa9a43
> 47817ff97e
>
> On Wed, Oct 11, 2017 at 3:07 PM, Claus Ibsen 
> wrote:
> > Ad 1)
> > Try upgrading Camel it may be a bug. However that configuration ought
> > to be in use. We have some examples that does that and it works.
> >
> > Ad 2)
> > You cannot, you can debug or turn on DEBUG/TRACE logging etc.
> >
> > Ad 3)
> > Dont think its exposed via JMX.
> > There is some details today via JMX on the hystrix processor in the
> > CAmel jmx tree. It would be nice somehow to get the state of the
> > breaker. You can welcome to dive in the code to see if you can find
> > out how.
> >
> >
> > It should be standard Hystrix so you can use its api to find the
> > circuit breakers and get its state. For example
> > HystrixEventStreamService uses a hystrix poller to get a stream of
> > data for all the circuit breakers in the JVM which is what its used to
> > populate data to the famous Hystrix Dashboard.
> >
> > Also each CAmel message that is processed via the hystrix has some
> > state after being processed, see HystrixConstants
> >
> > On Tue, Oct 10, 2017 at 9:59 PM, LiQiang Ye 
> wrote:
> >> Hi, camel friends
> >>
> >>  I have a few questions regarding camel hystrix java dsl.
> >>
> >> I am using hystrix in a route:
> >>
> >>
> >> from("direct:a").routeId("a_route")
> >> .hystrix()
> >> //question: how to print out or log configurations for this particular
> >> hystrix
> >> .to("bean:abean?method=execute")
> >> .onFallback()
> >> .to("bean:bBean?method=execute")
> >> //question: how to check if circuite break is open. If it's open, I
> would
> >> like to log a message.
> >> .end()
> >>
> >>
> >> 1) How can I pass camel hystrix global settings to the hystrix. I've
> >> configured the following entries in my application.yml file, but the
> >> hystrix didn't seem to pick up the configs.
> >>
> >> camel:
> >>   hystrix:
> >> execution-timeout-in-milliseconds: 0
> >> circuit-breaker-request-volume-threshold: 5
> >> circuit-breaker-error-threshold-percentage: 50
> >> circuit-breaker-sleep-window-in-milliseconds: 1
> >> metrics-rolling-percentile-window-in-milliseconds: 2
> >> metrics-rolling-percentile-window-buckets: 2
> >>
> >> 2) In above route, how can I print out a particular hystrix's configs
> >>
> >> 3) In above route, how do I know if a circuit break is open.
> >>
> >>
> >> Thanks
> >
> >
> >
> > --
> > 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: Urgent: Camel Hystrix Java DSL Questions

2017-10-11 Thread Claus Ibsen
Hi

Okay I found out a bit and logged a ticket
https://issues.apache.org/jira/browse/CAMEL-11895?

You can see this commit that can get the CB state
https://github.com/apache/camel/commit/ebf7b80c23006551f44000befa9a4347817ff97e

On Wed, Oct 11, 2017 at 3:07 PM, Claus Ibsen  wrote:
> Ad 1)
> Try upgrading Camel it may be a bug. However that configuration ought
> to be in use. We have some examples that does that and it works.
>
> Ad 2)
> You cannot, you can debug or turn on DEBUG/TRACE logging etc.
>
> Ad 3)
> Dont think its exposed via JMX.
> There is some details today via JMX on the hystrix processor in the
> CAmel jmx tree. It would be nice somehow to get the state of the
> breaker. You can welcome to dive in the code to see if you can find
> out how.
>
>
> It should be standard Hystrix so you can use its api to find the
> circuit breakers and get its state. For example
> HystrixEventStreamService uses a hystrix poller to get a stream of
> data for all the circuit breakers in the JVM which is what its used to
> populate data to the famous Hystrix Dashboard.
>
> Also each CAmel message that is processed via the hystrix has some
> state after being processed, see HystrixConstants
>
> On Tue, Oct 10, 2017 at 9:59 PM, LiQiang Ye  wrote:
>> Hi, camel friends
>>
>>  I have a few questions regarding camel hystrix java dsl.
>>
>> I am using hystrix in a route:
>>
>>
>> from("direct:a").routeId("a_route")
>> .hystrix()
>> //question: how to print out or log configurations for this particular
>> hystrix
>> .to("bean:abean?method=execute")
>> .onFallback()
>> .to("bean:bBean?method=execute")
>> //question: how to check if circuite break is open. If it's open, I would
>> like to log a message.
>> .end()
>>
>>
>> 1) How can I pass camel hystrix global settings to the hystrix. I've
>> configured the following entries in my application.yml file, but the
>> hystrix didn't seem to pick up the configs.
>>
>> camel:
>>   hystrix:
>> execution-timeout-in-milliseconds: 0
>> circuit-breaker-request-volume-threshold: 5
>> circuit-breaker-error-threshold-percentage: 50
>> circuit-breaker-sleep-window-in-milliseconds: 1
>> metrics-rolling-percentile-window-in-milliseconds: 2
>> metrics-rolling-percentile-window-buckets: 2
>>
>> 2) In above route, how can I print out a particular hystrix's configs
>>
>> 3) In above route, how do I know if a circuit break is open.
>>
>>
>> Thanks
>
>
>
> --
> 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: Urgent: Camel Hystrix Java DSL Questions

2017-10-11 Thread Claus Ibsen
Ad 1)
Try upgrading Camel it may be a bug. However that configuration ought
to be in use. We have some examples that does that and it works.

Ad 2)
You cannot, you can debug or turn on DEBUG/TRACE logging etc.

Ad 3)
Dont think its exposed via JMX.
There is some details today via JMX on the hystrix processor in the
CAmel jmx tree. It would be nice somehow to get the state of the
breaker. You can welcome to dive in the code to see if you can find
out how.


It should be standard Hystrix so you can use its api to find the
circuit breakers and get its state. For example
HystrixEventStreamService uses a hystrix poller to get a stream of
data for all the circuit breakers in the JVM which is what its used to
populate data to the famous Hystrix Dashboard.

Also each CAmel message that is processed via the hystrix has some
state after being processed, see HystrixConstants

On Tue, Oct 10, 2017 at 9:59 PM, LiQiang Ye  wrote:
> Hi, camel friends
>
>  I have a few questions regarding camel hystrix java dsl.
>
> I am using hystrix in a route:
>
>
> from("direct:a").routeId("a_route")
> .hystrix()
> //question: how to print out or log configurations for this particular
> hystrix
> .to("bean:abean?method=execute")
> .onFallback()
> .to("bean:bBean?method=execute")
> //question: how to check if circuite break is open. If it's open, I would
> like to log a message.
> .end()
>
>
> 1) How can I pass camel hystrix global settings to the hystrix. I've
> configured the following entries in my application.yml file, but the
> hystrix didn't seem to pick up the configs.
>
> camel:
>   hystrix:
> execution-timeout-in-milliseconds: 0
> circuit-breaker-request-volume-threshold: 5
> circuit-breaker-error-threshold-percentage: 50
> circuit-breaker-sleep-window-in-milliseconds: 1
> metrics-rolling-percentile-window-in-milliseconds: 2
> metrics-rolling-percentile-window-buckets: 2
>
> 2) In above route, how can I print out a particular hystrix's configs
>
> 3) In above route, how do I know if a circuit break is open.
>
>
> Thanks



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


Re: Camel Spring Boot: Bean initialization skipped in auto-configuration

2017-10-11 Thread Mark Nuttall
I looked at stacktrace and your code here. I agree with the comment about
the Map. The same thing can happen with strings. I am not sure what the map
does but you might be able to that in Spring properties. If not, either
create a class to hold the map and make that class the Bean or provide a
name to the Bean and make sure you use that when you inject the bean.

I think we are going to need a copy of code that does not work. I use
Spring Boot and Camel pretty extensively and while it is not without
issues, it was usually due to me doing something probably I shouldnt have
or there was a better way. :)

Also, as suggested, use constructor injection. The version of Boot you are
using makes it very easy - all you need is a single constructor on your
managed object (to include the RouteBuilder). And if you use Lombok, it is
even easier.

Mark

On Wed, Oct 11, 2017 at 4:41 AM, Florian Posch <
florian.po...@performgroup.com> wrote:

> Hi,
>
> I'm using Camel 2.19.3 and Spring Boot 1.5.7 including the corresponding
> Camel starter for my application and am having some issues with a custom
> InflightRepository getting set up.
>
> It is defined as Spring @Component and should get applied to the context
> by auto-configuration but the problem is that the bean isn't properly
> initialized
>
> @Component
> public class MyInflightRepository extends
> DefaultInflightRepository {
>
> @Autowired
> private MyInjectedBean bean;
>
> // ...
> }
>
>
> The repository gets applied to the CamelContext as well as it is available
> but to me it looks as if premature bean access in 
> CamelAutoConfiguration.afterPropertiesSet
> causes the bean not being initialiized properly (so @Autowired members
> remain null but Spring starts up without an error). As far as I understood
> this happens because Application.getBeansByType(...) gets called before
> all property resolvers are initialized.
>
> I was able to work around that by manually initializing my
> InflightRepository and setting it in a CamelConfiguration bean but for my
> taste this is a bit dangerous to scan for custom beans that might not get
> initialized properly during startup.
>
> There's a more detailed snippet given on my Stackoverflow post:
> https://stackoverflow.com/questions/46680985/spring-
> boot-camel-autowiring-issues-in-camel-components
>
> Any question, please let me know...
>
> Kind regards,
> Florian
>
> Florian Posch // Software Engineer
>
>
>
>
>
>
>
>
>
>
>
> T   -
>
> RunningBall Sports Information GmbH
> M  -
>
> Plabutscher Straße 63
> F   -
>
> 8051 Graz
> E   florian.po...@performgroup.com
>
> Austria
> Skype rb.fposch
>
>
>
>
> W www.performgroup.com
>
>
>


Camel Spring Boot: Bean initialization skipped in auto-configuration

2017-10-11 Thread Florian Posch
Hi,

I'm using Camel 2.19.3 and Spring Boot 1.5.7 including the corresponding Camel 
starter for my application and am having some issues with a custom 
InflightRepository getting set up.

It is defined as Spring @Component and should get applied to the context by 
auto-configuration but the problem is that the bean isn't properly initialized

@Component
public class MyInflightRepository extends DefaultInflightRepository {

@Autowired
private MyInjectedBean bean;

// ...
}


The repository gets applied to the CamelContext as well as it is available but 
to me it looks as if premature bean access in 
CamelAutoConfiguration.afterPropertiesSet  causes the bean not being 
initialiized properly (so @Autowired members remain null but Spring starts up 
without an error). As far as I understood this happens because 
Application.getBeansByType(...) gets called before all property resolvers are 
initialized.

I was able to work around that by manually initializing my InflightRepository 
and setting it in a CamelConfiguration bean but for my taste this is a bit 
dangerous to scan for custom beans that might not get initialized properly 
during startup.

There's a more detailed snippet given on my Stackoverflow post: 
https://stackoverflow.com/questions/46680985/spring-boot-camel-autowiring-issues-in-camel-components
 

Any question, please let me know...

Kind regards,
Florian

Florian Posch // Software Engineer











T   -

RunningBall Sports Information GmbH 
M  -

Plabutscher Straße 63 
F   -

8051 Graz 
E   florian.po...@performgroup.com 

Austria 
Skype rb.fposch




W www.performgroup.com