I am using Camel for integration in my Java project. I have a simple route as
follows:*RouteBuilder() { @Override public void
configure() throws Exception {
from("rabbitmq://localhost:5672/test?queue=task_queue&username=guest&password=guest&autoAck=true&durable=true&exchangeType=direct&autoDelete=false")
.throttle(5000) .timePeriodMillis(10000)
.to("rabbitmq://localhost:5672/test?queue=out_queue&username=guest&password=guest&autoAck=true&durable=true&exchangeType=direct&autoDelete=false");
} };* I am using Camel for integration in my Java project. I have a
simple route as follows: RouteBuilder() { @Override
public void configure() throws Exception {
from("rabbitmq://localhost:5672/test?queue=task_queue&username=guest&password=guest&autoAck=true&durable=true&exchangeType=direct&autoDelete=false")
.throttle(5000) .timePeriodMillis(10000)
.to("rabbitmq://localhost:5672/test?queue=out_queue&username=guest&password=guest&autoAck=true&durable=true&exchangeType=direct&autoDelete=false");
} };Say I have 1 message in my task_queue, and I want to transfer it
to out_queue using the above route. Whats happening here is; as soon as I
run my program it transfers 5k duplicate messages (of that 1 message in
task_queue) to out_queue in 10 seconds. But this is not what I want from my
throttler. I want to send max 5k messages to the out_queue, which means that
if there is only 1 message in the task_queue then it should route only that
message.Can you suggest what's wrong with my route? Any suggestion is
appreciated.Attached it the screenshot of rabbitmq management console (where
it had transferred 10k messages in 20 secs) .
<http://camel.465427.n5.nabble.com/file/n5755050/29.png> UPDATE: I have
figured out that problem is not with the throttler. I tried it without any
throttling, and then it was transferring arbitrary number of messages from
task_queue to out_queue (say around 10k+). It is happening when I am sending
a single message to task_queue. I am using Producer Template & Direct
component to send message to task_queue.ProducerTemplate template =
context.createProducerTemplate();template.sendBody("direct://input", "This
is a test message: ");
--
View this message in context:
http://camel.465427.n5.nabble.com/Camel-duplicating-messages-tp5755050.html
Sent from the Camel - Users mailing list archive at Nabble.com.