@Override public RetryOperationsInterceptor build() { this.applyCommonSettings(this.factoryBean); return this.factoryBean.getObject(); }
@Override public RetryOperationsInterceptor getObject() { RetryOperationsInterceptor retryInterceptor = new RetryOperationsInterceptor(); RetryOperations retryTemplate = getRetryOperations(); if (retryTemplate == null) { retryTemplate = new RetryTemplate(); } retryInterceptor.setRetryOperations(retryTemplate); final MessageRecoverer messageRecoverer = getMessageRecoverer(); retryInterceptor.setRecoverer((args, cause) -> { Message message = (Message) args[1]; if (messageRecoverer == null) { logger.warn("Message dropped on recovery: " + message, cause); } else { messageRecoverer.recover(message, cause); } return null; }); return retryInterceptor; }
private Advice createRetryInterceptor(final CountDownLatch latch, boolean stateful) throws Exception { AbstractRetryOperationsInterceptorFactoryBean factory; if (stateful) { factory = new StatefulRetryOperationsInterceptorFactoryBean(); } else { factory = new StatelessRetryOperationsInterceptorFactoryBean(); } factory.setMessageRecoverer((message, cause) -> { logger.warn("Recovered: [" + SerializationUtils.deserialize(message.getBody()).toString() + "], message: " + message); latch.countDown(); }); if (retryTemplate == null) { retryTemplate = new RetryTemplate(); } factory.setRetryOperations(retryTemplate); return factory.getObject(); }
@Override public RetryOperationsInterceptor getObject() { RetryOperationsInterceptor retryInterceptor = new RetryOperationsInterceptor(); RetryOperations retryTemplate = getRetryOperations(); if (retryTemplate == null) { retryTemplate = new RetryTemplate(); } retryInterceptor.setRetryOperations(retryTemplate); final MessageRecoverer messageRecoverer = getMessageRecoverer(); retryInterceptor.setRecoverer((args, cause) -> { Message message = (Message) args[1]; if (messageRecoverer == null) { logger.warn("Message dropped on recovery: " + message, cause); } else { messageRecoverer.recover(message, cause); } return null; }); return retryInterceptor; }
@Override public RetryOperationsInterceptor build() { this.applyCommonSettings(this.factoryBean); return this.factoryBean.getObject(); }