[
https://issues.apache.org/activemq/browse/CAMEL-1199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48308#action_48308
]
Hadrian Zbarcea commented on CAMEL-1199:
----------------------------------------
Ron, I tried to reproduce your issue and the throttler seems to work with the
following route. The Throttler code keeps everything per object, so as long as
there is one object everything seems ok. One odd thing I noticed is that at 3
messages per second I expected the whole thing to take a bit over 7 seconds,
but it takes (consistently) over 6 seconds (and a bit over 60 sec for 240
messages).
{code}
// START SNIPPET: ex
from("direct:a").thread(5).
throttler(3).timePeriodMillis(1000).to("mock:result");
// END SNIPPET: ex
{code}
and the client code makes invocations from multiple threads, as smx does. The
core pool size didn't infulence the results.
{code}
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(5);
executor.afterPropertiesSet();
long start = System.currentTimeMillis();
executor.execute(new Runnable() {
public void run() {
long start = System.currentTimeMillis();
for (int i = 0; i < messageCount; i++) {
template.sendBody("direct:a", "<message>" + i +
"</message>");
}
duration = System.currentTimeMillis() - start;
};
});
{code}
Can you please make it fail or give more details about what you experience?
How does your route look like?
> Throttler appears to "throttle" per thread instead of throttling across
> multiple threads
> ----------------------------------------------------------------------------------------
>
> Key: CAMEL-1199
> URL: https://issues.apache.org/activemq/browse/CAMEL-1199
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 1.5.0
> Reporter: Ron Gavlin
> Assignee: Hadrian Zbarcea
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.