SSL Settings for http component in blueprint

2017-05-10 Thread Jan Bernhardt
Hi Camel user,

I'm trying to connect to a REST Service (elasticsearch) via SSL with a
self-signed server certificate.

I've got it working fine with Java DSL according to the camel http component
documentation:
http://camel.apache.org/http.html (Using the JSSE Configuration Utility)

But now I have to get it working with blueprint as well. I could not find
any helpful documentation. I tried multiple alternatives, but none seemed to
work. For example I added this into my blueprint file:

http://camel.apache.org/schema/blueprint";>





But I still get a certificate validation exception, when connecting to my
REST service.

Any idea of, what needs to be done, to get this working with a self-signed
certificate?

Best regards
Jan




--
View this message in context: 
http://camel.465427.n5.nabble.com/SSL-Settings-for-http-component-in-blueprint-tp5799272.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: mongodb distinct query

2017-05-10 Thread Mark
Claus,

I created a ticket in JIRA and submitted a patch.  Let me know if there's
anything more I can do to support this functionality.

https://issues.apache.org/jira/browse/CAMEL-11259

Cheers,
Mark


On Tue, May 9, 2017 at 7:15 AM, Mark  wrote:

> Thanks Claus, I'm going to try and put together a patch and submit it.
>
> On Fri, May 5, 2017 at 3:45 PM, Claus Ibsen  wrote:
>
>> I frankly do not know if its supported or not. But if you have looked
>> in the docs and source code then its likely not.
>>
>> We love contributions so you are welcome to see what it takes to add
>> support for that.
>> http://camel.apache.org/contributing
>>
>> On Thu, May 4, 2017 at 7:14 AM, Mark  wrote:
>> > I'm trying to figure out if Camel supports distinct queries with the
>> > mongodb component.  I've looked through the docs and source code and
>> cannot
>> > see where that is supported.  Is this functionality supported in the
>> > camel-mongodb component and I just don't see it?
>> >
>> > Cheers,
>> > Mark
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>
>


Re: ERROR [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer]

2017-05-10 Thread chandler
I solved my problem (hang Queue listeners) by using the asyncRequestBody
(see:
http://camel.465427.n5.nabble.com/ProducerTemplate-timeout-td473382.html) 

JEE Container Servlet (HttpSessionTimeout)
   {
   Camel Routes 
  {
  JMS Request/Reply org.apache.camel.component.jms.JmsConfiguration
(requestTimeout)
 {
ProducerTemplate pt = 
exchange.getContext().createProducerTemplate();
Future future = pt.asyncRequestBody(jmsURL, 
payload);
// wait ...
results = pt.extractFutureBody(future, 
procedureTimeOut,
java.util.concurrent.TimeUnit.MILLISECONDS, String.class);
 }
  }
   }

Important: HttpSessionTimeout > JMS requestTimeout > procedureTimeOut 




--
View this message in context: 
http://camel.465427.n5.nabble.com/ERROR-org-apache-camel-component-jms-DefaultJmsMessageListenerContainer-tp5792757p5799257.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: OnApplicationEvent not called with CamelAutoConfiguration

2017-05-10 Thread Zoran Regvart
Hi,
I've created a pull request[1] to start the discussion if we could do
better in this case. Can you help by reviewing or checking it out and
trying it on your end to confirm that it helps?

thanks :)

[1] https://github.com/apache/camel/pull/1685

On Wed, May 10, 2017 at 9:48 PM, Zoran Regvart  wrote:
> Hi,
> if the promises stated at Graceful shutdown in the documentation[1]
> are broken then this is a bug, from the sideline to me this looks more
> like AMQ-3988[2].
>
> So as Claus was saying, if you have Spring managed JMS connection pool
> that is being shutdown before Camel gets to perform the graceful
> shutdown this can happen, so you need to make sure that the Camel is
> shutdown before the JMS connection pool.
>
> Camel Spring Boot support (IIRC) uses
> CamelSpringBootApplicationController[3] to perform the destruction.
>
> I don't know if there could be a mechanism in Camel's Spring Boot
> support to make this a bit easier on the user.
>
> zoran
>
> [1] https://camel.apache.org/graceful-shutdown.html
> [2] https://issues.apache.org/jira/browse/AMQ-3988
> [3] 
> https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java#L98-L101
>
> On Wed, May 10, 2017 at 9:11 PM, Hetmoteus  wrote:
>> So its not a bug in the SpringCamelContext handled by CamelAutoConfiguration
>> ?
>>
>> What you are saying is that its not related to the onApplicationEvent method
>> and the shutdownEager ?
>>
>> I'm lost really thought it was that and calling it was fixing it though ...
>>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/OnApplicationEvent-not-called-with-CamelAutoConfiguration-tp5798802p5799249.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Zoran Regvart



-- 
Zoran Regvart


Apache Shiro annotation support in Apache Camel

2017-05-10 Thread imranrazakhan
Hi,

I configured Apache Shiro in order perform authorisation of rest service, it
works fine as per provided examples but I want to use annotations like:

import org.apache.shiro.authz.annotation.RequiresPermissions;

@RequiresPermissions("my:create:message")
public void sendmessage() {
...
}

Those annoations are never evaluated.

Regards,



--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Shiro-annotation-support-in-Apache-Camel-tp5799253.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: OnApplicationEvent not called with CamelAutoConfiguration

2017-05-10 Thread Zoran Regvart
Hi,
if the promises stated at Graceful shutdown in the documentation[1]
are broken then this is a bug, from the sideline to me this looks more
like AMQ-3988[2].

So as Claus was saying, if you have Spring managed JMS connection pool
that is being shutdown before Camel gets to perform the graceful
shutdown this can happen, so you need to make sure that the Camel is
shutdown before the JMS connection pool.

Camel Spring Boot support (IIRC) uses
CamelSpringBootApplicationController[3] to perform the destruction.

I don't know if there could be a mechanism in Camel's Spring Boot
support to make this a bit easier on the user.

zoran

[1] https://camel.apache.org/graceful-shutdown.html
[2] https://issues.apache.org/jira/browse/AMQ-3988
[3] 
https://github.com/apache/camel/blob/master/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java#L98-L101

On Wed, May 10, 2017 at 9:11 PM, Hetmoteus  wrote:
> So its not a bug in the SpringCamelContext handled by CamelAutoConfiguration
> ?
>
> What you are saying is that its not related to the onApplicationEvent method
> and the shutdownEager ?
>
> I'm lost really thought it was that and calling it was fixing it though ...
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/OnApplicationEvent-not-called-with-CamelAutoConfiguration-tp5798802p5799249.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Zoran Regvart


Camel 2.17.4 - High CPU Utilization

2017-05-10 Thread Chang
Hi,

We are using the below ThreadPoolProfile configuration in our application





When found for high CPU Utilization, we analyzed the application using Java
Flight Recorder and found that we are spawning 4500+ threads but we have
configured to support maxPoolSize of 2500 for the above three
threadPoolProfile.

Would like to know the reason for higher thread usage than configured. 
Camel Version: 2.17.4

Thanks in Advance.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-17-4-High-CPU-Utilization-tp5799251.html
Sent from the Camel - Users mailing list archive at Nabble.com.


onFailureOnly onCompleteOnly does not produce the right route

2017-05-10 Thread sekaijin
I have a road defined as well

where onCompletion onException onFailure are functions


The route builder produce only onException  and onFailure

If I change the order of call functions

I've


only one of onCompleteOnly or onFailureOnly is produced

haw to add onCompleteOnly and onFailureOnly ?

thank
JYT



--
View this message in context: 
http://camel.465427.n5.nabble.com/onFailureOnly-onCompleteOnly-does-not-produce-the-right-route-tp5799244.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: OnApplicationEvent not called with CamelAutoConfiguration

2017-05-10 Thread Hetmoteus
So its not a bug in the SpringCamelContext handled by CamelAutoConfiguration
?

What you are saying is that its not related to the onApplicationEvent method
and the shutdownEager ?

I'm lost really thought it was that and calling it was fixing it though ...



--
View this message in context: 
http://camel.465427.n5.nabble.com/OnApplicationEvent-not-called-with-CamelAutoConfiguration-tp5798802p5799249.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: problem when using elasticsearch5 component with camel-2.19.0

2017-05-10 Thread Zoran Regvart
Hi Rachid,
you seem to be missing `org.elasticsearch.transport.Netty3Plugin`
class, perhaps the ServiceMix users forum at:
http://servicemix.396122.n5.nabble.com/ServiceMix-User-f396123.html

can help you with that,

zoran


On Wed, May 10, 2017 at 7:02 PM, Rachid KRAIEM  wrote:
> Hi everybody,
>
> I've install camel-elasticsearch5 component with the newer apache-2.19.0
> into karaf-4.0.7 container
>
> my camel route is as follow:
>
>
>
> the problem is when trying to install my bundle, i have the following
> problem
>
>
>
> Can you help me ??
>
> Regards,
> Rachid KRAIEM
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/problem-when-using-elasticsearch5-component-with-camel-2-19-0-tp5799247.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Zoran Regvart


problem when using elasticsearch5 component with camel-2.19.0

2017-05-10 Thread Rachid KRAIEM
Hi everybody,

I've install camel-elasticsearch5 component with the newer apache-2.19.0
into karaf-4.0.7 container 

my camel route is as follow:



the problem is when trying to install my bundle, i have the following
problem



Can you help me ??

Regards,
Rachid KRAIEM




--
View this message in context: 
http://camel.465427.n5.nabble.com/problem-when-using-elasticsearch5-component-with-camel-2-19-0-tp5799247.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel with embedded ActiveMQ / Web-Console

2017-05-10 Thread Zoran Regvart
Hi Burner,
have you configured the Spring Boot Maven plugin?[1]

zoran

[1] 
https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-maven-plugin.html
-- 
Zoran Regvart


Re: Async bean method

2017-05-10 Thread Zoran Regvart
Hi Morten,
are you using the JMS component? Take a look at `concurrentConsumers`
and `asyncConsumer` properties[1],

zoran

[1] https://camel.apache.org/jms.html#JMS-ConcurrentConsuming

On Wed, May 10, 2017 at 4:20 PM, mortalisk  wrote:
> Guess I am mistaken about whenComplete blocking the thread. I thought that
> was the difference of *Async and not in the CompletableFuture, so never mind
> that.
>
> However I still see this behaviour where only one message is processed at a
> time, even though all the code is running in a separate thread pool.
>
>
>
> -
> Morten Bendiksen
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Async-bean-method-tp5799201p5799235.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Zoran Regvart


Properties dynamic doesnt work

2017-05-10 Thread angelwine
Hi, i'm using camel 2.17.6 in Servicemix 7.

i try to use LOOP to dynamically use key properties , it doesnt work
Did i missed domething ! then header CamelFilePath don't substitute ???

*Here the content of my properties file:*


*Here my code:*



*Here my log*





--
View this message in context: 
http://camel.465427.n5.nabble.com/Properties-dynamic-doesnt-work-tp5799241.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Configuring Quartz in cfg file (Property placeholder)

2017-05-10 Thread Claus Ibsen
You can use classpath: as prefix to refer to the classpath. And file:
to refer to the file system. Then you can refer to the KARAF_HOME/etc
folder and the file name there.

On Wed, May 10, 2017 at 3:42 PM, Kevin-Void  wrote:
> Yes Claus.. Is there a way to use quartz.properties file externally like cfg
> file or properties file outside the jar :(
>
> Regards,
> Kevin
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Configuring-Quartz-in-cfg-file-Property-placeholder-tp5799160p5799232.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: Camel with embedded ActiveMQ / Web-Console

2017-05-10 Thread burner
I get it now to work, but only when I make "mvn camel:run". But I want "mvn
package". Knows anyone, what I must do?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-with-embedded-ActiveMQ-Web-Console-tp5798586p5799238.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem using setProperty() with groovy() on optional Field

2017-05-10 Thread Mic
Thanks for your reply. I tried this before, but the property "source" is then
null in the next steps even if the source field was present in the XML.
Really strange..

btw: Camel Version is 2.17.1

best regards



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-using-setProperty-with-groovy-on-optional-Field-tp5799222p5799236.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem using setProperty() with groovy() on optional Field

2017-05-10 Thread Mic
Hi,

it found a solution which works but it is not really nice to me.. any ideas
to make it smarter?

..
choice().when(body().convertToString().contains("\"source\"")).setProperty("source").groovy("request.body.source").end()
...

Best regards



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-using-setProperty-with-groovy-on-optional-Field-tp5799222p5799230.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Configuring Quartz in cfg file (Property placeholder)

2017-05-10 Thread Kevin-Void
Yes Claus.. Is there a way to use quartz.properties file externally like cfg
file or properties file outside the jar :(

Regards,
Kevin



--
View this message in context: 
http://camel.465427.n5.nabble.com/Configuring-Quartz-in-cfg-file-Property-placeholder-tp5799160p5799232.html
Sent from the Camel - Users mailing list archive at Nabble.com.


ad vitam aeternam redelivery

2017-05-10 Thread sekaijin
Hi,

I need to define an endpoint with the following characteristics:
Transactional route from jms to any protocols (user-defined protolole during
config)
Retry every x seconds in case of failure
No attempt limit
Rollback if the route stops after a failure.

I work with camel 2.16

Thank you for your help.



--
View this message in context: 
http://camel.465427.n5.nabble.com/ad-vitam-aeternam-redelivery-tp5799234.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem using setProperty() with groovy() on optional Field

2017-05-10 Thread souciance
That's strange.

I mean worst case scenario, create an inline processor and extract the xml
and check the field and extract the field value and put in source
property.This way you are sure what should happen.

On Wed, May 10, 2017 at 4:29 PM, Mic [via Camel] <
ml+s465427n5799236...@n5.nabble.com> wrote:

> Thanks for your reply. I tried this before, but the property "source" is
> then null in the next steps even if the source field was present in the
> XML. Really strange..
>
> btw: Camel Version is 2.17.1
>
> best regards
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Problem-using-setProperty-
> with-groovy-on-optional-Field-tp5799222p5799236.html
> To start a new topic under Camel - Users, email ml+s465427n465428h31@n5.
> nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-using-setProperty-with-groovy-on-optional-Field-tp5799222p5799237.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Async bean method

2017-05-10 Thread mortalisk
Guess I am mistaken about whenComplete blocking the thread. I thought that
was the difference of *Async and not in the CompletableFuture, so never mind
that. 

However I still see this behaviour where only one message is processed at a
time, even though all the code is running in a separate thread pool.



-
Morten Bendiksen
--
View this message in context: 
http://camel.465427.n5.nabble.com/Async-bean-method-tp5799201p5799235.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Async bean method

2017-05-10 Thread mortalisk
My route:


In the executor bean (only message type was changed to :


It definitely seems to only run the "process" method one by one. I added a
sleep in "preProcess" (which is inside the "thenApplyAsync" so it should not
block the camel thread, which would make it wait for that much longer until
next message would start. I would expect it to call the "process" for each
item in the queue immediately.

I looked at the camel code and found this line:
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java#L324

I'm not sure if this is the code that is involved, but that would block the
thread if I'm not mistaken.








--
View this message in context: 
http://camel.465427.n5.nabble.com/Async-bean-method-tp5799201p5799233.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem using setProperty() with groovy() on optional Field

2017-05-10 Thread souciance
I don't know the groovy version but simple language has null safe operator.
Can't you write it like this:

.setProperty("source").simple("${request.body.source?")

See here for examples:
http://camel.apache.org/simple.html

On Wed, May 10, 2017 at 3:32 PM, Mic [via Camel] <
ml+s465427n5799230...@n5.nabble.com> wrote:

> Hi,
>
> it found a solution which works but it is not really nice to me.. any
> ideas to make it smarter?
>
> ..
> choice().when(body().convertToString().contains("\"
> source\"")).setProperty("source").groovy("request.body.source").end()
> ...
>
> Best regards
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Problem-using-setProperty-
> with-groovy-on-optional-Field-tp5799222p5799230.html
> To start a new topic under Camel - Users, email ml+s465427n465428h31@n5.
> nabble.com
> To unsubscribe from Camel - Users, click here
> 
> .
> NAML
> 
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-using-setProperty-with-groovy-on-optional-Field-tp5799222p5799231.html
Sent from the Camel - Users mailing list archive at Nabble.com.

ProducerTemplate thread waits indefinitely

2017-05-10 Thread CamelJMSUser
I am using producerTemplate.asyncCallback(., ., .) method to publish messages
to Tibco EMS. While running my application, if EMS server down then so-many
threads as blocking and my server is creating lot of blocking threads then
it moving to out of memory issue

 here is the connection code 

TibjmsConnectionFactory tibjmsConnectionFactory = new
TibjmsConnectionFactory(); 
tibjmsConnectionFactory.setServerUrl(""); 
tibjmsConnectionFactory.setUserName(""); 
tibjmsConnectionFactory.setUserPassword(""); 
tibjmsConnectionFactory.setReconnAttemptCount(10); 
tibjmsConnectionFactory.setReconnAttemptDelay(1000); 
tibjmsConnectionFactory.setReconnAttemptTimeout(1000); 
tibjmsConnectionFactory.setConnAttemptTimeout(100); 
SingleConnectionFactory singleConnectionFactory = new
SingleConnectionFactory(); 
singleConnectionFactory.setTargetConnectionFactory(tibjmsConnectionFactory); 
TibcoConnectionExceptionListener tibcoConnectionExceptionListener = new
TibcoConnectionExceptionListener(); 
singleConnectionFactory.setExceptionListener(tibcoConnectionExceptionListener); 
singleConnectionFactory.setReconnectOnException(reconnectOnException); 
cacheConnectionFactory = new CachingConnectionFactory(); 
cacheConnectionFactory.setTargetConnectionFactory(singleConnectionFactory); 
cacheConnectionFactory.setSessionCacheSize(50); 

and here is the publisher code 
producerTemplate.asyncCallback(queueName, exchange,synchronization); 

And I attached thread dump, when Tibco EMS down, all producer thread are
blocked and those are not releasing then will get OOM issue   
ThreadDump.xlsx
  

I am using camel-core/camel-spring/camel-jms 2.11.1 version.

I saw in camel documentation issue with Camel  API producer process()
method.

Please help me to resolve this issue

Please help me to resolve the issue.



--
View this message in context: 
http://camel.465427.n5.nabble.com/ProducerTemplate-thread-waits-indefinitely-tp5799224.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Problem using setProperty() with groovy() on optional Field

2017-05-10 Thread Mic
Hi guys,

i struggle with the following case. I have a "body" with some fields like
"title", "source" etc..

Now i would like to set a Property with the value in field "source". The
problem is, the field is optional, so it is not present always.

It works if it is present with
".setProperty("source").groovy("request.body.source")" but crash if field
"source" is not available .. But how can i enrich this part with the option
that "source" is not available. I tried null safe groovy syntax,
choice()/when() route and so on..

Can you please tell me the correct syntax to check if "request.body.source"
is available, if true, setProperty with the value.. if not present, ignore..

Thanks a lot for your help.
Best Regards



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-using-setProperty-with-groovy-on-optional-Field-tp5799222.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: OnApplicationEvent not called with CamelAutoConfiguration

2017-05-10 Thread Claus Ibsen
You need somehow to tell spring to shutdown those thread pools last,
there is some way of defining bean ordering or depends-on in spring.
Check the spring docs

On Wed, May 10, 2017 at 1:40 PM, Hetmoteus  wrote:
> Hi,
>
> When I shutdown the application with at least 1 inflight exchange I get the
> following logs :
>
> 2017-05-04 18:21:59.748  WARN 12188 --- [er[test.queue]]
> o.a.activemq.jms.pool.PooledSession  : Caught exception trying
> rollback() when putting session back into the pool, will invalidate.
> javax.jms.IllegalStateException: The Session is closed
>
> After some investigation via breakpoints.
> On shutdown the ConnectionFactory.stop() method is called before the
> CamelContext is shutdown.
>
> After more investigation, SpringCamelContext has a method called
> "onApplicationEvent" which is handling the spring shutdown. But this method
> is never called.
>
> Is that normal ? When I create a @Component which @Inject SpringCamelContext
> and call it manually it works.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/OnApplicationEvent-not-called-with-CamelAutoConfiguration-tp5798802p5799221.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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


Re: OnApplicationEvent not called with CamelAutoConfiguration

2017-05-10 Thread Hetmoteus
Hi,

When I shutdown the application with at least 1 inflight exchange I get the
following logs :

2017-05-04 18:21:59.748  WARN 12188 --- [er[test.queue]]
o.a.activemq.jms.pool.PooledSession  : Caught exception trying
rollback() when putting session back into the pool, will invalidate.
javax.jms.IllegalStateException: The Session is closed

After some investigation via breakpoints.
On shutdown the ConnectionFactory.stop() method is called before the
CamelContext is shutdown.

After more investigation, SpringCamelContext has a method called
"onApplicationEvent" which is handling the spring shutdown. But this method
is never called.

Is that normal ? When I create a @Component which @Inject SpringCamelContext
and call it manually it works.



--
View this message in context: 
http://camel.465427.n5.nabble.com/OnApplicationEvent-not-called-with-CamelAutoConfiguration-tp5798802p5799221.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: OnApplicationEvent not called with CamelAutoConfiguration

2017-05-10 Thread Zoran Regvart
Hi,
I'm not sure that I follow what you're saying, but from what I observe
using the JMS and SJMS components is that the connections get closed
when the Camel consumer endpoints are closed.

Also I see no way of destroying the ConnectionFactory (not in the
public JMS API interface, nor in the ActiveMQ implementation of it),
do you mean JMS Connection gets closed?

Connections need to be closed before Camel context shutdown, and they
should be closed when the consumer endpoints are stopped, are you
seeing something else?

zoran

On Sat, May 6, 2017 at 2:34 PM, Hetmoteus  wrote:
> Hi,
>
> I'm using SpringBoot with camel
> 1.4.3.RELEASE
> 2.18.3
>
> CamelContext is auto configured via :
> CamelAutoConfiguration
>
> If I understand correctly the SpringCamelContext is instancied via
> CamelAutoConfiguration class and not by CamelContextFactoryBean.
>
> Since https://issues.apache.org/jira/browse/CAMEL-2607, the
> SpringCamelContext doesn't implement ApplicationListener interface anymore.
>
> It seems like onApplicationEvent is not called on the SpringCamelContext
> which in my situation cause the AMQ ConnectionFactory to be destroyed before
> the camel graceful shutdown.
>
> Anyone has this issue or can confirm ?
> Has a fix, I created a component which is listening ApplicationEvent and
> forwarding them to injected SpringCamelContext.
>
> Thanks
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/OnApplicationEvent-not-called-with-CamelAutoConfiguration-tp5798802.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Zoran Regvart


Re: Async bean method

2017-05-10 Thread Zoran Regvart
Hi Morten,
are you sure about this? Could it be that your own code is blocking
the consumer.

I just run a simple example with the file consumer and an bean
processor returning CompletionStage.
>From what I observe is that the consumer thread keeps polling the
filesystem even if I sleep in the thread that the producer bean
started for the CompletionStage.

Can you share your route and the code of the bean that's performing
the processing?

zoran

On Wed, May 10, 2017 at 9:46 AM, mortalisk  wrote:
> Hi, I am trying to return CompletableFuture from my bean method in order to
> be able to consume more messages while processing while processing previous
> ones. However, I see no difference in behaviour. I seems the consumer thread
> is waiting for the future to complete.
>
> What is the purpose of the ability to return CompletableFuture from bean
> methods? Am I seeing the expected behaviour?
>
> See the headline Asynchronous processing here:
> http://camel.apache.org/bean-binding.html
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Async-bean-method-tp5799201.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Zoran Regvart


Async bean method

2017-05-10 Thread mortalisk
Hi, I am trying to return CompletableFuture from my bean method in order to
be able to consume more messages while processing while processing previous
ones. However, I see no difference in behaviour. I seems the consumer thread
is waiting for the future to complete.

What is the purpose of the ability to return CompletableFuture from bean
methods? Am I seeing the expected behaviour?

See the headline Asynchronous processing here:
http://camel.apache.org/bean-binding.html



--
View this message in context: 
http://camel.465427.n5.nabble.com/Async-bean-method-tp5799201.html
Sent from the Camel - Users mailing list archive at Nabble.com.