I am using rabbitmq component in camel. I have a following route:
public void configure() throws Exception {
from("rabbitmq://localhost:5672/test_op?queue=out_queue&routingKey=test_out&username=guest&password=guest"
+
"&autoAck=false&durable=true&exchangeType=direct&autoDelete=false&exchangePattern=InOut")
.aggregate(constant(true), new
ArrayListAggregationStrategy())
.completionSize(2000).completionTimeout(60000).eagerCheckCompletion()
.process(new Processor() {
@Override
public void process(Exchange exchange) throws
Exception {
Message m = exchange.getIn();
org.apache.camel.TypeConverter tc =
exchange.getContext().getTypeConverter();
String strValue = tc.convertTo(String.class,
m.getBody());
System.out.println("[[out_queue]]: " +
strValue);
}
});
}
Problem is that the use of aggregate is acknowledging the message to
rabbitmq even before process() is called. I want to acknowledge message only
when process() execution is successful, and not when aggregate is invoked.
How can I achieve this?
FYI: Without aggregate this route works as expected. That means it
acknowledges message only when process() is executed successfully.
--
View this message in context:
http://camel.465427.n5.nabble.com/aggregate-acknowledging-message-to-rabbitmq-tp5755435.html
Sent from the Camel - Users mailing list archive at Nabble.com.