I have following route:
from("jms-test:queue:queue.delivery.notification.test")
.process(processor)
.onException(Exception.class).retryUntil(bean("myRetryBean")).end()
.recipientList(header("recipientListHeader").tokenize(","))
.parallelProcessing().executorService(customThreadPoolExecutor)
.aggregationStrategy(new RecipientAggregationStrategy())
.to("direct:chunk.completed");
bean is registered in such way:
JndiRegistry jndi = new JndiRegistry(new JndiContext());
jndi.bind("myRetryBean", new RetryBean());
bean class is:
public class RetryBean {
private int _invoked;
private Logger _logger;
public RetryBean() {
this._logger = Logger.getLogger(RetryBean.class);
this._invoked = 0;
_logger.debug("BEAN INITIALIZED " + _invoked);
}
// using bean binding we can bind the information from the exchange to
the types we have in our method signature
public boolean retryUntil(@Header(Exchange.REDELIVERY_COUNTER) Integer
counter, @Body String body, @ExchangeException Exception causedBy) {
// NOTE: counter is the redelivery attempt, will start from 1
_invoked++;
_logger.debug("invoked" + _invoked);
_logger.debug("counter" + counter);
_logger.debug("result" + (counter < 2));
// we can of course do what ever we want to determine the result but
this is a unit test so we end after 3 attempts
return counter < 7;
}
the bean gets intialized but it looks like the method retryUntil is never
called, could it be an error of implementation? am I doing something wrong?
--
View this message in context:
http://old.nabble.com/recipientList-retryUntil-not-working--tp27145846p27145846.html
Sent from the Camel - Users mailing list archive at Nabble.com.