[jira] [Work started] (CAMEL-10542) DataFormat from registry is used for every dataformat operation (marshal/unmarshal)

2016-12-02 Thread Luca Burgazzoli (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-10542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Work on CAMEL-10542 started by Luca Burgazzoli.
---
> DataFormat from registry is used for every dataformat operation 
> (marshal/unmarshal)
> ---
>
> Key: CAMEL-10542
> URL: https://issues.apache.org/jira/browse/CAMEL-10542
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Reporter: Luca Burgazzoli
>Assignee: Luca Burgazzoli
> Fix For: 2.18.2, 2.19.0
>
>
> While working on an issue related to spring-boot I found out that if a data 
> format is registered in camel registry with the same name as the one camel 
> looks-up with the help of DefaultDataFormatResolver, this object is then 
> re-configured for each data format definition so one definition may override 
> previous configuration with an undefined behavior.
> So assume you have an xml route definitions as:
> {code:xml}
> http://camel.apache.org/schema/spring;>
>   
> 
> 
>   
> 
>   
>   
> 
> 
>   
> 
>   
> 
> {code}
> And some code like:
> {code:java}
> InputStream is = getClass().getResourceAsStream("...");
> SimpleRegistry reg = new SimpleRegistry();
> reg.put("csv-dataformat", new CsvDataFormat());
> DefaultCamelContext ctx = new DefaultCamelContext(reg);
> ctx.addRouteDefinitions(ctx.loadRoutesDefinition(is).getRoutes());
> ctx.start();
> ProducerTemplate template = ctx.createProducerTemplate();
> String result = template.requestBody(
> "direct:marshal",
> Arrays.asList(Arrays.asList( "A1", "B1", "C1" )),
> String.class);
> assertEquals("A1,B1,C1", result);
> ctx.stop
> {code}
> Then this test fails with:
> {code}
> Expected :A1,B1,C1
> Actual   :A1;B1;C1
> {code}
> It fails because the object added to the SimpleRegistry is shared among the 
> two csv dataformats  so it is configured to have delimiter = ';' 
> For spring-boot this causes some issues as it registers data formats beans as 
> part of its auto-configuration magic thus if you do not set your own instance 
> of data format, any data format operation like marshal/unmarshal may not work 
> as expected. 
> - for spring-boot a solution would be to annotate auto configured data format 
> beans with prototype scope.
> - a more generic solution would be to make DataFormat Cloneable and clone the 
> bean found in the registry



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work started] (CAMEL-10550) spring-boot: add a global option to disable data-format e language auto configurations

2016-12-02 Thread Luca Burgazzoli (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-10550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Work on CAMEL-10550 started by Luca Burgazzoli.
---
> spring-boot: add a global option to disable data-format e language auto 
> configurations
> --
>
> Key: CAMEL-10550
> URL: https://issues.apache.org/jira/browse/CAMEL-10550
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-spring-boot
>Reporter: Luca Burgazzoli
>Assignee: Luca Burgazzoli
>Priority: Minor
> Fix For: 2.18.2, 2.19.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10391) Camel-CDI adds every RouteBuilder instance it can find to Camel context

2016-12-02 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15715677#comment-15715677
 ] 

Claus Ibsen commented on CAMEL-10391:
-

Please update the release notes with this new feature/change
http://camel.apache.org/camel-219-release.html

> Camel-CDI adds every RouteBuilder instance it can find to Camel context
> ---
>
> Key: CAMEL-10391
> URL: https://issues.apache.org/jira/browse/CAMEL-10391
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-cdi
> Environment: Wildfly 10 with wildfly-camel extension
>Reporter: Sverker Abrahamsson
>Assignee: Antonin Stefanutti
> Fix For: 2.19.0
>
>
> Camel-CDI will find every class in a deployment which extends RouteBuilder 
> and automatically add them to the context. This is a major issue for me as I 
> usually wants to instantiate my RouteBuilders programatically setting various 
> parameters, with CDI support.
> This behaviour was introduced with 
> https://github.com/apache/camel/commit/0421c24dfcf992f3296ed746469771e3800200e3
>  from [~antonin.stefanutti] and we had a good discussion about the issue on 
> his github project in https://github.com/astefanutti/camel-cdi/issues/12 but 
> never came up with a good solution for it. I have patched camel-cdi to use a 
> marker annotation @DoNotAddToCamelContext to work around it but I don't want 
> to have to patch every release I use..
> I understand the logic why Camel-CDI finds and add every RouteBuilder class, 
> even though I don't agree that it is a good idea but it could very well be 
> the default behavior as long as it is possible to override it.
> What I would like is a discussion on how this could be made configurable. I'm 
> thinking about if there could be an annotation like 
> @CamelContextStartup(false) or maybe even a more general 
> @CamelContextConfig(autostart=false) if there are other things that should be 
> configurable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10272) Aggregation is broken due to race condition in ParallelAggregateTask.doAggregateInternal()

2016-12-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15715672#comment-15715672
 ] 

ASF GitHub Bot commented on CAMEL-10272:


Github user asfgit closed the pull request at:

https://github.com/apache/camel/pull/1326


> Aggregation is broken due to race condition in 
> ParallelAggregateTask.doAggregateInternal()
> --
>
> Key: CAMEL-10272
> URL: https://issues.apache.org/jira/browse/CAMEL-10272
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 2.16.3, 2.17.3
> Environment: MacOS 10.11.6, JRE 1.7.0_79
>Reporter: Peter Keller
>
> Unfortunately, I am not able to provide a (simple) unit test for 
> comprehending the problem. Furthermore our (complex) unit tests are not 
> deterministic due to the root cause of the problem.
> However I tried to analyze the Camel Java code, to work out the problem. 
> Please find below my findings.
> h3. Problem
> The {{oldExchange}} is {{null}} more than once in the aggregator if a 
> recipient list is processed in parallel.
> h3. Camel route
> In my Camel route, a recipient list is worked of in parallel:
> {code}
>  from("direct:start")
> .to("direct:pre")
> .recipientList().method(new MyRecipientListBuilder())
> .stopOnException()
> .aggregationStrategy(new MyAggregationStrategy())
> .parallelProcessing()
> .end()
> .bean(new MyPostProcessor());
> {code}
> Snippet of {{MyAggregationStrategy}}:
> {code}
> @Override
> @SuppressWarnings("unchecked")
> public Exchange aggregate(final Exchange oldExchange, final Exchange 
> newExchange) {
> if (oldExchange == null) {
> // this is the case more than once which is not expected!
> }
> // ...
> {code}
> {{oldExchange}} is null more than once which is not expected and which 
> contradicts the contract with Camel.
> h3. Analysis
> During the processing, Camel invokes {{MulticastProcessor.process()}}. Here 
> the result object {{AtomicExchange}} is created which is shared during the 
> whole processing.
> If the processing should be done in parallel (as it is the case for our 
> route) then {{MulticastProcessor.doProcessParallel()}} is invoked. Here one 
> instance of {{AggregateOnTheFlyTask}} is initialized and 
> {{aggregateOnTheFly()}} is invoked -*asynchronously* via {{run()}}  for 
> *every* target in the recipient list-. via 
> {{aggregateExecutorService.submit}} ({{aggregationTaskSubmitted}} guarantees 
> that this is only be done once)
> In {{aggregateOnTheFly()}}, a new instance of {{ParallelAggregateTask}} is 
> generated, and if aggregation is not done in parallel (as it is the case in 
> our route), {{ParallelAggregateTask.run()}}, 
> {{ParallelAggregateTask.doAggregate()}} (this method is synchronized), and 
> {{ParallelAggregateTask.doAggregateInternal()}} is invoked synchronously:
> {code}
> protected void doAggregateInternal(AggregationStrategy strategy, 
> AtomicExchange result, Exchange exchange) {
> if (strategy != null) {
> // prepare the exchanges for aggregation
> Exchange oldExchange = result.get();
> ExchangeHelper.prepareAggregation(oldExchange, exchange);
> result.set(strategy.aggregate(oldExchange, exchange));
> }
> } 
> {code}
> However, in {{ParallelAggregateTask.doAggregateInternal()}} there may occur a 
> race condition as {{result}} is shared -by every instance of 
> {{AggregateOnTheFlyTask}}- such that {{oldExchange = result.get()}} may be 
> {{null}} more than once!
> Note: As a new instance of {{ParallelAggregateTask}} for every target in 
> recipient list is created, the {{synchronized}} method 
> {{ParallelAggregateTask.doAggregate()}} does not prevent the race condition!
> Does this sounds reasonably?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10391) Camel-CDI adds every RouteBuilder instance it can find to Camel context

2016-12-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15715631#comment-15715631
 ] 

ASF GitHub Bot commented on CAMEL-10391:


Github user asfgit closed the pull request at:

https://github.com/apache/camel/pull/1319


> Camel-CDI adds every RouteBuilder instance it can find to Camel context
> ---
>
> Key: CAMEL-10391
> URL: https://issues.apache.org/jira/browse/CAMEL-10391
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-cdi
> Environment: Wildfly 10 with wildfly-camel extension
>Reporter: Sverker Abrahamsson
>Assignee: Antonin Stefanutti
> Fix For: 2.19.0
>
>
> Camel-CDI will find every class in a deployment which extends RouteBuilder 
> and automatically add them to the context. This is a major issue for me as I 
> usually wants to instantiate my RouteBuilders programatically setting various 
> parameters, with CDI support.
> This behaviour was introduced with 
> https://github.com/apache/camel/commit/0421c24dfcf992f3296ed746469771e3800200e3
>  from [~antonin.stefanutti] and we had a good discussion about the issue on 
> his github project in https://github.com/astefanutti/camel-cdi/issues/12 but 
> never came up with a good solution for it. I have patched camel-cdi to use a 
> marker annotation @DoNotAddToCamelContext to work around it but I don't want 
> to have to patch every release I use..
> I understand the logic why Camel-CDI finds and add every RouteBuilder class, 
> even though I don't agree that it is a good idea but it could very well be 
> the default behavior as long as it is possible to override it.
> What I would like is a discussion on how this could be made configurable. I'm 
> thinking about if there could be an annotation like 
> @CamelContextStartup(false) or maybe even a more general 
> @CamelContextConfig(autostart=false) if there are other things that should be 
> configurable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (CAMEL-10550) spring-boot: add a global option to disable data-format e language auto configurations

2016-12-02 Thread Luca Burgazzoli (JIRA)
Luca Burgazzoli created CAMEL-10550:
---

 Summary: spring-boot: add a global option to disable data-format e 
language auto configurations
 Key: CAMEL-10550
 URL: https://issues.apache.org/jira/browse/CAMEL-10550
 Project: Camel
  Issue Type: Improvement
  Components: camel-spring-boot
Reporter: Luca Burgazzoli
Assignee: Luca Burgazzoli
Priority: Minor
 Fix For: 2.18.2, 2.19.0






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10549) NullPointerException when trying to process response from bridged http jetty endpoint

2016-12-02 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15715191#comment-15715191
 ] 

Claus Ibsen commented on CAMEL-10549:
-

Try with 2.17.4 and 2.18.1 - the latter is release next week

> NullPointerException when trying to process response from bridged http jetty 
> endpoint
> -
>
> Key: CAMEL-10549
> URL: https://issues.apache.org/jira/browse/CAMEL-10549
> Project: Camel
>  Issue Type: Bug
>Affects Versions: 2.18.0
>Reporter: Frank Wein
>
> First things first: This looks like a regression to me, with version 2.17.3 
> (org.apache.camelcamel-parent2.17.3)
>  in my pom.xml this still worked fine. In version 2.18.0 it's broken. I could 
> not find a similar issue here in this bugtracker (I found something at 
> https://issues.jboss.org/browse/ENTESB-5872, but don't think this is related, 
> although the stack trace is similar; fuse 6.3 does not use Camel 2.18 AFAIK).
> With the attached code example I get an exception/stacktrace when calling the 
> REST endpoint (producer) via http://localhost/API/1/. With Camel 2.17.3 I get 
> the expected response from the processor.
> Stacktrace:
> [hread #0 - JmsConsumer[test]] EndpointMessageListenerWARN  Execution 
> of JMS message listener failed. Caused by: 
> [org.apache.camel.RuntimeCamelException - java.lang.NullPointerException]
> org.apache.camel.RuntimeCamelException: java.lang.NullPointerException
>   at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1690)
>  ~[camel-core-2.18.0.jar:2.18.0]
>   at 
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:133)
>  ~[camel-jms-2.18.0.jar:2.18.0]
>   at 
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:721)
>  ~[spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:681)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:651)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1166)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1158)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1055)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  [?:1.8.0_101]
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  [?:1.8.0_101]
>   at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
> Caused by: java.lang.NullPointerException
>   at 
> org.apache.activemq.camel.component.OriginalDestinationPropagateStrategy.onMessageCreated(OriginalDestinationPropagateStrategy.java:45)
>  ~[activemq-camel-5.14.0.jar:5.14.0]
>   at 
> org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:309) 
> ~[camel-jms-2.18.0.jar:2.18.0]
>   at 
> org.apache.camel.component.jms.EndpointMessageListener$1.createMessage(EndpointMessageListener.java:371)
>  ~[camel-jms-2.18.0.jar:2.18.0]
>   at 
> org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:515)
>  ~[camel-jms-2.18.0.jar:2.18.0]
>   at 
> org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:458)
>  ~[camel-jms-2.18.0.jar:2.18.0]
>   at 
> org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$4.doInJms(JmsConfiguration.java:501)
>  ~[camel-jms-2.18.0.jar:2.18.0]
>   at 
> org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:484) 
> ~[spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> 

[jira] [Comment Edited] (CAMEL-10549) NullPointerException when trying to process response from bridged http jetty endpoint

2016-12-02 Thread Frank Wein (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15714982#comment-15714982
 ] 

Frank Wein edited comment on CAMEL-10549 at 12/2/16 12:20 PM:
--

Additional comment: On http://localhost: I'm running another REST 
webservice that is responding to the HTTP request.

Code used to test this:
{noformat}
getContext().addComponent("activemq",

ActiveMQComponent.activeMQComponent("vm://localhost?broker.persistent=false"));

restConfiguration().component("jetty").host("0.0.0.0").port(8080)
.dataFormatProperty("prettyPrint", "true");

rest("/API/").get("/{ID}/").to("direct:objectGet");

from("direct:objectGet").to(ExchangePattern.InOut, "activemq:test");

from("activemq:test").setHeader(Exchange.HTTP_PATH, 
simple("/Webservice/${header.ID}"))
.to("jetty://http://localhost:?bridgeEndpoint=true;).process(new 
Processor() {
public void process(Exchange exchange) throws Exception {
   exchange.getIn().setBody("Changed body");
}
});
{noformat}


was (Author: fwein):
Additional comment: On http://localhost: I'm running another REST 
webservice that is responding to the HTTP request.

Code used to test this:
{noformat}
getContext().addComponent("activemq",

ActiveMQComponent.activeMQComponent("vm://localhost?broker.persistent=false"));

restConfiguration().component("jetty").host("0.0.0.0").port(8080)
.dataFormatProperty("prettyPrint", "true");

rest("/API/").get("/{ID}/").to("direct:objectGet");

from("direct:objectGet").to(ExchangePattern.InOut, "activemq:ossbss");

from("activemq:test").setHeader(Exchange.HTTP_PATH, 
simple("/Webservice/${header.ID}"))
.to("jetty://http://localhost:?bridgeEndpoint=true;).process(new 
Processor() {
public void process(Exchange exchange) throws Exception {
   exchange.getIn().setBody("Changed body");
}
});
{noformat}

> NullPointerException when trying to process response from bridged http jetty 
> endpoint
> -
>
> Key: CAMEL-10549
> URL: https://issues.apache.org/jira/browse/CAMEL-10549
> Project: Camel
>  Issue Type: Bug
>Affects Versions: 2.18.0
>Reporter: Frank Wein
>
> First things first: This looks like a regression to me, with version 2.17.3 
> (org.apache.camelcamel-parent2.17.3)
>  in my pom.xml this still worked fine. In version 2.18.0 it's broken. I could 
> not find a similar issue here in this bugtracker (I found something at 
> https://issues.jboss.org/browse/ENTESB-5872, but don't think this is related, 
> although the stack trace is similar; fuse 6.3 does not use Camel 2.18 AFAIK).
> With the attached code example I get an exception/stacktrace when calling the 
> REST endpoint (producer) via http://localhost/API/1/. With Camel 2.17.3 I get 
> the expected response from the processor.
> Stacktrace:
> [hread #0 - JmsConsumer[test]] EndpointMessageListenerWARN  Execution 
> of JMS message listener failed. Caused by: 
> [org.apache.camel.RuntimeCamelException - java.lang.NullPointerException]
> org.apache.camel.RuntimeCamelException: java.lang.NullPointerException
>   at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1690)
>  ~[camel-core-2.18.0.jar:2.18.0]
>   at 
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:133)
>  ~[camel-jms-2.18.0.jar:2.18.0]
>   at 
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:721)
>  ~[spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:681)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:651)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1166)
>  [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
>   at 
> 

[jira] [Created] (CAMEL-10549) NullPointerException when trying to process response from bridged http jetty endpoint

2016-12-02 Thread Frank Wein (JIRA)
Frank Wein created CAMEL-10549:
--

 Summary: NullPointerException when trying to process response from 
bridged http jetty endpoint
 Key: CAMEL-10549
 URL: https://issues.apache.org/jira/browse/CAMEL-10549
 Project: Camel
  Issue Type: Bug
Affects Versions: 2.18.0
Reporter: Frank Wein


First things first: This looks like a regression to me, with version 2.17.3 
(org.apache.camelcamel-parent2.17.3)
 in my pom.xml this still worked fine. In version 2.18.0 it's broken. I could 
not find a similar issue here in this bugtracker (I found something at 
https://issues.jboss.org/browse/ENTESB-5872, but don't think this is related, 
although the stack trace is similar; fuse 6.3 does not use Camel 2.18 AFAIK).

With the attached code example I get an exception/stacktrace when calling the 
REST endpoint (producer) via http://localhost/API/1/. With Camel 2.17.3 I get 
the expected response from the processor.

Stacktrace:
[hread #0 - JmsConsumer[test]] EndpointMessageListenerWARN  Execution 
of JMS message listener failed. Caused by: 
[org.apache.camel.RuntimeCamelException - java.lang.NullPointerException]
org.apache.camel.RuntimeCamelException: java.lang.NullPointerException
at 
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1690)
 ~[camel-core-2.18.0.jar:2.18.0]
at 
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:133)
 ~[camel-jms-2.18.0.jar:2.18.0]
at 
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:721)
 ~[spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at 
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:681)
 [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at 
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:651)
 [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at 
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317)
 [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at 
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)
 [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1166)
 [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1158)
 [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1055)
 [spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
[?:1.8.0_101]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
[?:1.8.0_101]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.lang.NullPointerException
at 
org.apache.activemq.camel.component.OriginalDestinationPropagateStrategy.onMessageCreated(OriginalDestinationPropagateStrategy.java:45)
 ~[activemq-camel-5.14.0.jar:5.14.0]
at 
org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:309) 
~[camel-jms-2.18.0.jar:2.18.0]
at 
org.apache.camel.component.jms.EndpointMessageListener$1.createMessage(EndpointMessageListener.java:371)
 ~[camel-jms-2.18.0.jar:2.18.0]
at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:515)
 ~[camel-jms-2.18.0.jar:2.18.0]
at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:458)
 ~[camel-jms-2.18.0.jar:2.18.0]
at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$4.doInJms(JmsConfiguration.java:501)
 ~[camel-jms-2.18.0.jar:2.18.0]
at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:484) 
~[spring-jms-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:499)
 ~[camel-jms-2.18.0.jar:2.18.0]
at 
org.apache.camel.component.jms.EndpointMessageListener.sendReply(EndpointMessageListener.java:369)
 ~[camel-jms-2.18.0.jar:2.18.0]
at 
org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:222)
 ~[camel-jms-2.18.0.jar:2.18.0]
at 

[jira] [Resolved] (CAMEL-10486) Google PubSub Component does not consume messages with parallel consumers

2016-12-02 Thread Andrea Cosentino (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-10486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrea Cosentino resolved CAMEL-10486.
--
Resolution: Fixed

> Google PubSub Component does not consume messages with parallel consumers
> -
>
> Key: CAMEL-10486
> URL: https://issues.apache.org/jira/browse/CAMEL-10486
> Project: Camel
>  Issue Type: Bug
>Reporter: Evgeny Minkevich
>Assignee: Andrea Cosentino
> Fix For: 2.19.0
>
>
> Component: camel-google-pubsub
> When parallelConsumers option on an endpoint is assigned the value greater 
> than 1, the component will not be receiving messages.
> The issue has been traced to the underlying Google library used and I will 
> update the component once the fix is available. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10486) Google PubSub Component does not consume messages with parallel consumers

2016-12-02 Thread Andrea Cosentino (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15714625#comment-15714625
 ] 

Andrea Cosentino commented on CAMEL-10486:
--

We can wait for the new library from google and leave this open, but it doesn't 
make sense. I close this one and in case I will update the dependency directly

> Google PubSub Component does not consume messages with parallel consumers
> -
>
> Key: CAMEL-10486
> URL: https://issues.apache.org/jira/browse/CAMEL-10486
> Project: Camel
>  Issue Type: Bug
>Reporter: Evgeny Minkevich
> Fix For: 2.19.0
>
>
> Component: camel-google-pubsub
> When parallelConsumers option on an endpoint is assigned the value greater 
> than 1, the component will not be receiving messages.
> The issue has been traced to the underlying Google library used and I will 
> update the component once the fix is available. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Assigned] (CAMEL-10486) Google PubSub Component does not consume messages with parallel consumers

2016-12-02 Thread Andrea Cosentino (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-10486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrea Cosentino reassigned CAMEL-10486:


Assignee: Andrea Cosentino

> Google PubSub Component does not consume messages with parallel consumers
> -
>
> Key: CAMEL-10486
> URL: https://issues.apache.org/jira/browse/CAMEL-10486
> Project: Camel
>  Issue Type: Bug
>Reporter: Evgeny Minkevich
>Assignee: Andrea Cosentino
> Fix For: 2.19.0
>
>
> Component: camel-google-pubsub
> When parallelConsumers option on an endpoint is assigned the value greater 
> than 1, the component will not be receiving messages.
> The issue has been traced to the underlying Google library used and I will 
> update the component once the fix is available. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (CAMEL-10547) No Exception on invalid charset option

2016-12-02 Thread Claus Ibsen (JIRA)

 [ 
https://issues.apache.org/jira/browse/CAMEL-10547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-10547.
-
Resolution: Cannot Reproduce

> No Exception on invalid charset option
> --
>
> Key: CAMEL-10547
> URL: https://issues.apache.org/jira/browse/CAMEL-10547
> Project: Camel
>  Issue Type: Bug
>Affects Versions: 2.18.0
> Environment: windows 7
>Reporter: morten skou nielsen
>Priority: Minor
>
> I get no exception when building this:
> .toD("file://" + outputDirectory + File.separator + 
> "?fileExist=Append=$(header.inputFileEncoding)");
> The code only breaks when i try to write to the file due to 
> NoSuchFileException. 
> I would have expected to get a camel.FailedToCreateRouteException since the 
> charset option is invalid
> see nable
> http://camel.465427.n5.nabble.com/dynamic-endpoint-with-dynamic-encoding-td5790768.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10486) Google PubSub Component does not consume messages with parallel consumers

2016-12-02 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15714617#comment-15714617
 ] 

Claus Ibsen commented on CAMEL-10486:
-

Is there more work to this or did the last PR implement this?

> Google PubSub Component does not consume messages with parallel consumers
> -
>
> Key: CAMEL-10486
> URL: https://issues.apache.org/jira/browse/CAMEL-10486
> Project: Camel
>  Issue Type: Bug
>Reporter: Evgeny Minkevich
> Fix For: 2.19.0
>
>
> Component: camel-google-pubsub
> When parallelConsumers option on an endpoint is assigned the value greater 
> than 1, the component will not be receiving messages.
> The issue has been traced to the underlying Google library used and I will 
> update the component once the fix is available. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CAMEL-10542) DataFormat from registry is used for every dataformat operation (marshal/unmarshal)

2016-12-02 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15714387#comment-15714387
 ] 

Claus Ibsen commented on CAMEL-10542:
-

Ah okay, yeah give that a try and see how that goes.


> DataFormat from registry is used for every dataformat operation 
> (marshal/unmarshal)
> ---
>
> Key: CAMEL-10542
> URL: https://issues.apache.org/jira/browse/CAMEL-10542
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Reporter: Luca Burgazzoli
>Assignee: Luca Burgazzoli
> Fix For: 2.18.2, 2.19.0
>
>
> While working on an issue related to spring-boot I found out that if a data 
> format is registered in camel registry with the same name as the one camel 
> looks-up with the help of DefaultDataFormatResolver, this object is then 
> re-configured for each data format definition so one definition may override 
> previous configuration with an undefined behavior.
> So assume you have an xml route definitions as:
> {code:xml}
> http://camel.apache.org/schema/spring;>
>   
> 
> 
>   
> 
>   
>   
> 
> 
>   
> 
>   
> 
> {code}
> And some code like:
> {code:java}
> InputStream is = getClass().getResourceAsStream("...");
> SimpleRegistry reg = new SimpleRegistry();
> reg.put("csv-dataformat", new CsvDataFormat());
> DefaultCamelContext ctx = new DefaultCamelContext(reg);
> ctx.addRouteDefinitions(ctx.loadRoutesDefinition(is).getRoutes());
> ctx.start();
> ProducerTemplate template = ctx.createProducerTemplate();
> String result = template.requestBody(
> "direct:marshal",
> Arrays.asList(Arrays.asList( "A1", "B1", "C1" )),
> String.class);
> assertEquals("A1,B1,C1", result);
> ctx.stop
> {code}
> Then this test fails with:
> {code}
> Expected :A1,B1,C1
> Actual   :A1;B1;C1
> {code}
> It fails because the object added to the SimpleRegistry is shared among the 
> two csv dataformats  so it is configured to have delimiter = ';' 
> For spring-boot this causes some issues as it registers data formats beans as 
> part of its auto-configuration magic thus if you do not set your own instance 
> of data format, any data format operation like marshal/unmarshal may not work 
> as expected. 
> - for spring-boot a solution would be to annotate auto configured data format 
> beans with prototype scope.
> - a more generic solution would be to make DataFormat Cloneable and clone the 
> bean found in the registry



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (CAMEL-10542) DataFormat from registry is used for every dataformat operation (marshal/unmarshal)

2016-12-02 Thread Luca Burgazzoli (JIRA)

[ 
https://issues.apache.org/jira/browse/CAMEL-10542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15713012#comment-15713012
 ] 

Luca Burgazzoli edited comment on CAMEL-10542 at 12/2/16 7:58 AM:
--

I was thinking about a real factory that can create an instance of a 
dataformat, like what you can achieve by annotate a method with prototype scope 
in spring and similar to what happen when we create an instance from a resource 
file except you can provide a data format with your own defaults.


was (Author: lb):
I was thinking about a real factory that can create an instance of a 
dataformat, like what you can achieve by annotate a method with prototype scope 
in spring

> DataFormat from registry is used for every dataformat operation 
> (marshal/unmarshal)
> ---
>
> Key: CAMEL-10542
> URL: https://issues.apache.org/jira/browse/CAMEL-10542
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core
>Reporter: Luca Burgazzoli
>Assignee: Luca Burgazzoli
> Fix For: 2.18.2, 2.19.0
>
>
> While working on an issue related to spring-boot I found out that if a data 
> format is registered in camel registry with the same name as the one camel 
> looks-up with the help of DefaultDataFormatResolver, this object is then 
> re-configured for each data format definition so one definition may override 
> previous configuration with an undefined behavior.
> So assume you have an xml route definitions as:
> {code:xml}
> http://camel.apache.org/schema/spring;>
>   
> 
> 
>   
> 
>   
>   
> 
> 
>   
> 
>   
> 
> {code}
> And some code like:
> {code:java}
> InputStream is = getClass().getResourceAsStream("...");
> SimpleRegistry reg = new SimpleRegistry();
> reg.put("csv-dataformat", new CsvDataFormat());
> DefaultCamelContext ctx = new DefaultCamelContext(reg);
> ctx.addRouteDefinitions(ctx.loadRoutesDefinition(is).getRoutes());
> ctx.start();
> ProducerTemplate template = ctx.createProducerTemplate();
> String result = template.requestBody(
> "direct:marshal",
> Arrays.asList(Arrays.asList( "A1", "B1", "C1" )),
> String.class);
> assertEquals("A1,B1,C1", result);
> ctx.stop
> {code}
> Then this test fails with:
> {code}
> Expected :A1,B1,C1
> Actual   :A1;B1;C1
> {code}
> It fails because the object added to the SimpleRegistry is shared among the 
> two csv dataformats  so it is configured to have delimiter = ';' 
> For spring-boot this causes some issues as it registers data formats beans as 
> part of its auto-configuration magic thus if you do not set your own instance 
> of data format, any data format operation like marshal/unmarshal may not work 
> as expected. 
> - for spring-boot a solution would be to annotate auto configured data format 
> beans with prototype scope.
> - a more generic solution would be to make DataFormat Cloneable and clone the 
> bean found in the registry



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)