Re: soTimeout ignored by camel http component

2016-02-03 Thread yuktisinghal
In my current application camel is used as an intermediate queue
for handling the request.when my server is start up , we set up the
routes.In the routes we define define timeout .My routebuilder class is

from(consumerUri).to(TO_INFO).process(new CamelReceiveProcessor));

Here TO_INFO = jetty://${header.headerProducerURI}?httpClient.timeout=15000

And the header.headerPrpducerURI is passed at runtime. 

But that timeout is set for all the requests.

I want to override this value of timeout dynamically with each request.

How to do it???

Also, i tried not setting it at configure method but passing it through
Exchange.HTTPURI OR Exchange.HTTPQUERY.But as mentioned 
Above it was completely ignored.it does not gives timeout exception.

So my query is how can we override already set settings like timeout 
During run time ??



--
View this message in context: 
http://camel.465427.n5.nabble.com/soTimeout-ignored-by-camel-http-component-tp5746289p5777182.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JPAProducer intances are never released!

2016-02-03 Thread ursouca
Dears,

One interresting thing.

When I disable the JMX agent the jpaProducer instances are released and
garbage collected.
It seems to me that is the JMX agent is keeping reference on the JpaProducer
objects making them never released.
Now I am wondering if it is a misconfiguration or it is a bug.
As short time solution, I will disable the JMX agent. But in a mid  term
solution I need to reactivate it because I need to monitor it with HAWTIO.

Br,
Cataldo.



--
View this message in context: 
http://camel.465427.n5.nabble.com/JPAProducer-intances-are-never-released-tp5777101p5777181.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: soTimeout ignored by camel http component

2016-02-03 Thread Andreas Siepert
You could pass the whole uri as header parameter. If i rember right this
works since 2.16 for to()  - if using an older version you could use the
EIP recipientList

Hope that helps
Andi

2016-02-03 11:02 GMT+01:00 yuktisinghal :

> In my current application camel is used as an intermediate queue
> for handling the request.when my server is start up , we set up the
> routes.In the routes we define define timeout .My routebuilder class is
>
> from(consumerUri).to(TO_INFO).process(new CamelReceiveProcessor));
>
> Here TO_INFO = jetty://${header.headerProducerURI}?httpClient.timeout=15000
>
> And the header.headerPrpducerURI is passed at runtime.
>
> But that timeout is set for all the requests.
>
> I want to override this value of timeout dynamically with each request.
>
> How to do it???
>
> Also, i tried not setting it at configure method but passing it through
> Exchange.HTTPURI OR Exchange.HTTPQUERY.But as mentioned
> Above it was completely ignored.it does not gives timeout exception.
>
> So my query is how can we override already set settings like timeout
> During run time ??
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/soTimeout-ignored-by-camel-http-component-tp5746289p5777182.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


camel-jsonpath gives error when you add the dependency to the pom file

2016-02-03 Thread souciance
Hello,

I have added the following dependency to my pom.xml.


org.apache.camel
camel-jsonpath
2.16.1


Without add any jsonpath code, and just running it afterwards I get the
below error. If I remove that dependency and run it everything works. Is
there something wrong with the component?


EventDispatcher: Error during dispatch.
EventDispatcher: Error during dispatch.
org.osgi.framework.ServiceException: Service factory exception:
org/objectweb/asm/commons/AdviceAdapter
at
org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:246)
at
org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:178)
at
org.apache.felix.connect.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:323)
at
org.apache.felix.connect.PojoSRBundleContext.getService(PojoSRBundleContext.java:162)
at
org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.addingService(NamespaceHandlerRegistryImpl.java:113)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)
at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:894)
at
org.apache.felix.connect.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:852)
at
org.apache.felix.connect.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:775)
at
org.apache.felix.connect.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:594)
at org.apache.felix.connect.PojoSR$1.serviceChanged(PojoSR.java:78)
at
org.apache.felix.connect.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:130)
at
org.apache.felix.connect.PojoSRBundleContext.registerService(PojoSRBundleContext.java:101)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:453)
at
org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:193)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:704)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:379)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
at
org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError:
org/objectweb/asm/commons/AdviceAdapter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at
org.apache.aries.proxy.impl.interfaces.ProxyClassLoader.createProxyClass(ProxyClassLoader.java:146)
at
org.apache.aries.proxy.impl.interfaces.InterfaceProxyGenerator.getProxyInstance(InterfaceProxyGenerator.java:95)
at
org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:80)
at

Component camel-jsonpath gives error after adding to pom file

2016-02-03 Thread souciance
Hello,

In a clean Camel project I add the following dependency:


org.apache.camel
camel-jsonpath
2.16.1   


When I run the project I get the below error. If I remove that dependency it
works. I have tried this on two different projects and the same happens.
Anything else that has to be added to the pom for jsonpath to work? It seems
to complain for ASM?

[INFO] Using org.apache.camel.test.blueprint.Main to initiate a CamelContext
[INFO] Starting Camel ...
[mel.test.blueprint.Main.main()] Activator  INFO  Camel
activator starting
[mel.test.blueprint.Main.main()] Activator  INFO  Camel
activator started
[ Blueprint Extender: 1] BlueprintContainerImpl INFO  Bundle
INT001_GetPostcodeDataFromXXX/0.0.1.SNAPSHOT is waiting for namespace
handlers [http://camel.apache.org/schema/blueprint]
EventDispatcher: Error during dispatch.
EventDispatcher: Error during dispatch.
EventDispatcher: Error during dispatch.
EventDispatcher: Error during dispatch.
EventDispatcher: Error during dispatch.
org.osgi.framework.ServiceException: Service factory exception:
org/objectweb/asm/commons/AdviceAdapter
at
org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:246)
at
org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:178)
at
org.apache.felix.connect.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:323)
at
org.apache.felix.connect.PojoSRBundleContext.getService(PojoSRBundleContext.java:162)
at
org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.addingService(NamespaceHandlerRegistryImpl.java:113)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)
at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:894)
at
org.apache.felix.connect.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:852)
at
org.apache.felix.connect.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:775)
at
org.apache.felix.connect.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:594)
at org.apache.felix.connect.PojoSR$1.serviceChanged(PojoSR.java:78)
at
org.apache.felix.connect.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:130)
at
org.apache.felix.connect.PojoSRBundleContext.registerService(PojoSRBundleContext.java:101)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:453)
at
org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:193)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:704)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:379)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
at
org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError:
org/objectweb/asm/commons/AdviceAdapter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at 

XmlRpc marshalling issue

2016-02-03 Thread Bernard Ligny
I am trying to issue a (very) basic request using:

   @Override
public void configure() {

XmlRpcDataFormat xmlrpcRequest = new XmlRpcDataFormat();
xmlrpcRequest.setRequest(true); 
..

from("direct:processMsg")
.id("process-route2"
.marshal(xmlrpcRequest)
.log(INFO, "About to post: ${body}")

.to("xmlrpc:http://"+backendHost+backendServiceUrl+"?synchronous=true=test;);
}


When a see the log, it seems that the original body (an "Hello world"
string) is marshalled as a *response* although the setRequest(true) on the
XmlRpcDataFormat...

17:35:27,235 INFO  [process-route2] (Camel (esb) thread #1 - About to post:
Hello world


What am I doing wrong ??

Bernard.





--
View this message in context: 
http://camel.465427.n5.nabble.com/XmlRpc-marshalling-issue-tp5777193.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Transaction problem with Camel, ActiveMQ and Spring JMS

2016-02-03 Thread Stephan Burkard
Yes, same broker. There is only one ActiveMQ connection config in the
project.



On Wed, Feb 3, 2016 at 8:00 PM, Quinn Stevenson  wrote:

> Are both the source and destination queues hosted by the same ActiveMQ
> broker?
>
>
>
> > On Feb 3, 2016, at 8:21 AM, Stephan Burkard  wrote:
> >
> > Hi
> >
> > I have built a small Maven project (attached) to demonstrate a JMS
> transaction problem in Camel routes under certain load conditions. In fact
> I am losing messages between two queues.
> >
> > The project contains two different flavours of the same test. One of
> them suffers from the problem, the other (due to my tests) not.
> >
> >
> > *** What does the testcase?
> > 1. Produces 1000 messages (100/s) and sends them to an "input" queue.
> > 2. Sends the messages from the "input" queue to an "output" queue.
> > 3. Finally consumes the messages from the "output" queue to count them.
> >
> >
> > *** What is the difference between the two test flavours?
> > - There is a "standard" flavour that suffers from the problem
> > - And there is a "noTxManager" flavour that seems to not have the problem
> > - The "standard" flavour is kind of a well known Camel/ActiveMQ
> configuration
> >   - with a Spring transaction manager
> >   - with a Spring transaction policy
> >   - With a "transacted" flag in Camel routes
> > - The "noTxManager" flavour is a "simple" configuration
> >   - no Spring transaction manager
> >   - no Spring transaction policy
> >   - no "transacted" flag in Camel routes
> >   - BUT: "lazyCreateTransactionManager" = false (so routes are
> transacted too)
> >
> >
> > *** How to run the testcases?
> > 1. Replace "[yourBrokerHost]" with the hostname of your ActiveMQ broker
> > 2. Run the testcase as JUnit test
> > 3. When you see lots of console messages that messages are sent, stop
> your ActiveMQ broker (do not kill-9 it, just shut it down normally)
> > 4. Exceptions are thrown on the console output
> > 5. After some seconds start your broker again
> > 6. The test finish normally and after some seconds dumps a book keeping
> on the console
> >
> >
> > *** How to interpret the results?
> > - When the test is successful, no message is lost. You can run the test
> without broker shutdown/startup and it will obviously always be successful.
> > - When the test fails, one or more messages are lost between queue
> "input" and "output". In my tests I was not able to run the "standard"
> flavour three times in a row successfully. About every second run failed.
> In contrast, the "noTxManager" flavour never failed in my tests.
> >
> > The book keeping for a failed test looks like the following. In this
> example Message number 281 is arrived at the input queue but not at the
> output queue. So it is lost.
> >
> > Messages created by Client:  1000
> > Client Exceptions during send:   0 []
> >
> > Messages received at input queue:993
> > Missing Messages at input queue: 7 [282,283,284,285,286,287,288]
> > Duplicate Messages at input queue:   0 []
> >
> > Messages received at output queue:   992
> > Missing Messages at output queue:8 [281,282,283,284,285,286,287,288]
> > Duplicate Messages at output queue:  0 []
> >
> > Lost Messages between Queues:1 [281]
> >
> >
> > *** What is the problem?
> > A Redhat engineer tracked the problem down to a Spring JMS template
> behaviour that is kind of strange. If a Spring transaction manager is
> defined in the config, it will end up with two of them. Therefore the small
> time range where messages can get lost that arises only when you have a
> certain load.
> >
> >
> > *** So, what is my question?
> > - Does this really mean that it is unsafe to use the "standard" flavour
> of configuration?
> > - Is there another config with TxManager etc that works correctly?
> > - What are limits of the "noTxManager" config? When is it not sufficent?
> >
> > Regards
> > Stephan
> >
> >
> >
> >
> > 
>
>


Re: Camle-Swagger-Java- documenting optional param for REST Service

2016-02-03 Thread Matt Sicker
Use required="false" in your param element.

On 2 February 2016 at 17:59, urwithsumit  wrote:

> Hi,
>
> Currently while documenting the REST Service we are giving param name as
> below:
>
> 
>
> This marks the param as mandatory and when we are testing it with
> swagger-ui
> we are forced to give value for this param.
>
> I want to document this param as an optional param. How can this be
> achieved?
>
> Note: We are using Camel 2.16.1 and working with Camel-swagger-java
> component.
>
> Regards
> Sumit
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camle-Swagger-Java-documenting-optional-param-for-REST-Service-tp5777172.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Matt Sicker 


Re: camel-jsonpath gives error when you add the dependency to the pom file

2016-02-03 Thread souciance
Note that it seems I had to add:


org.ow2.asm
asm-commons
5.0.3
runtime


in order for this to work.

But I am guessing this cannot be the correct way or?



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-jsonpath-gives-error-when-you-add-the-dependency-to-the-pom-file-tp5777185p5777187.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel-jsonpath gives error when you add the dependency to the pom file

2016-02-03 Thread souciance
Hello,

In a clean Camel project I add the following dependency:


org.apache.camel
camel-jsonpath
2.16.1   


When I run the project I get the below error. If I remove that dependency it
works. I have tried this on two different projects and the same happens.
Anything else that has to be added to the pom for jsonpath to work? It seems
to complain for ASM?

[INFO] Using org.apache.camel.test.blueprint.Main to initiate a CamelContext
[INFO] Starting Camel ...
[mel.test.blueprint.Main.main()] Activator  INFO  Camel
activator starting
[mel.test.blueprint.Main.main()] Activator  INFO  Camel
activator started
[ Blueprint Extender: 1] BlueprintContainerImpl INFO  Bundle
INT001_GetPostcodeDataFromXXX/0.0.1.SNAPSHOT is waiting for namespace
handlers [http://camel.apache.org/schema/blueprint]
EventDispatcher: Error during dispatch.
EventDispatcher: Error during dispatch.
EventDispatcher: Error during dispatch.
EventDispatcher: Error during dispatch.
EventDispatcher: Error during dispatch.
org.osgi.framework.ServiceException: Service factory exception:
org/objectweb/asm/commons/AdviceAdapter
at
org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:246)
at
org.apache.felix.connect.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:178)
at
org.apache.felix.connect.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:323)
at
org.apache.felix.connect.PojoSRBundleContext.getService(PojoSRBundleContext.java:162)
at
org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.addingService(NamespaceHandlerRegistryImpl.java:113)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)
at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at
org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:894)
at
org.apache.felix.connect.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:852)
at
org.apache.felix.connect.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:775)
at
org.apache.felix.connect.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:594)
at org.apache.felix.connect.PojoSR$1.serviceChanged(PojoSR.java:78)
at
org.apache.felix.connect.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:130)
at
org.apache.felix.connect.PojoSRBundleContext.registerService(PojoSRBundleContext.java:101)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:453)
at
org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:193)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:704)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:379)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106)
at
org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError:
org/objectweb/asm/commons/AdviceAdapter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at 

Re: Camle-Swagger-Java- documenting optional param for REST Service

2016-02-03 Thread urwithsumit
Thanks Matt. It fixed the issue.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camle-Swagger-Java-documenting-optional-param-for-REST-Service-tp5777172p5777194.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Transaction problem with Camel, ActiveMQ and Spring JMS

2016-02-03 Thread Quinn Stevenson
Are both the source and destination queues hosted by the same ActiveMQ broker?



> On Feb 3, 2016, at 8:21 AM, Stephan Burkard  wrote:
> 
> Hi
> 
> I have built a small Maven project (attached) to demonstrate a JMS 
> transaction problem in Camel routes under certain load conditions. In fact I 
> am losing messages between two queues. 
> 
> The project contains two different flavours of the same test. One of them 
> suffers from the problem, the other (due to my tests) not. 
> 
> 
> *** What does the testcase?
> 1. Produces 1000 messages (100/s) and sends them to an "input" queue. 
> 2. Sends the messages from the "input" queue to an "output" queue. 
> 3. Finally consumes the messages from the "output" queue to count them. 
> 
> 
> *** What is the difference between the two test flavours?
> - There is a "standard" flavour that suffers from the problem 
> - And there is a "noTxManager" flavour that seems to not have the problem
> - The "standard" flavour is kind of a well known Camel/ActiveMQ configuration
>   - with a Spring transaction manager 
>   - with a Spring transaction policy 
>   - With a "transacted" flag in Camel routes 
> - The "noTxManager" flavour is a "simple" configuration
>   - no Spring transaction manager 
>   - no Spring transaction policy 
>   - no "transacted" flag in Camel routes 
>   - BUT: "lazyCreateTransactionManager" = false (so routes are transacted too)
> 
> 
> *** How to run the testcases?
> 1. Replace "[yourBrokerHost]" with the hostname of your ActiveMQ broker
> 2. Run the testcase as JUnit test
> 3. When you see lots of console messages that messages are sent, stop your 
> ActiveMQ broker (do not kill-9 it, just shut it down normally)
> 4. Exceptions are thrown on the console output
> 5. After some seconds start your broker again
> 6. The test finish normally and after some seconds dumps a book keeping on 
> the console
> 
> 
> *** How to interpret the results?
> - When the test is successful, no message is lost. You can run the test 
> without broker shutdown/startup and it will obviously always be successful. 
> - When the test fails, one or more messages are lost between queue "input" 
> and "output". In my tests I was not able to run the "standard" flavour three 
> times in a row successfully. About every second run failed. In contrast, the 
> "noTxManager" flavour never failed in my tests. 
> 
> The book keeping for a failed test looks like the following. In this example 
> Message number 281 is arrived at the input queue but not at the output queue. 
> So it is lost.
>  
> Messages created by Client:  1000
> Client Exceptions during send:   0 []
>  
> Messages received at input queue:993
> Missing Messages at input queue: 7 [282,283,284,285,286,287,288]
> Duplicate Messages at input queue:   0 []
>  
> Messages received at output queue:   992
> Missing Messages at output queue:8 [281,282,283,284,285,286,287,288]
> Duplicate Messages at output queue:  0 []
>  
> Lost Messages between Queues:1 [281]
> 
> 
> *** What is the problem? 
> A Redhat engineer tracked the problem down to a Spring JMS template behaviour 
> that is kind of strange. If a Spring transaction manager is defined in the 
> config, it will end up with two of them. Therefore the small time range where 
> messages can get lost that arises only when you have a certain load.
> 
> 
> *** So, what is my question?
> - Does this really mean that it is unsafe to use the "standard" flavour of 
> configuration? 
> - Is there another config with TxManager etc that works correctly?
> - What are limits of the "noTxManager" config? When is it not sufficent? 
> 
> Regards
> Stephan
> 
> 
> 
> 
>