Package org.springframework.amqp.rabbit.config

Examples of org.springframework.amqp.rabbit.config.AbstractRetryOperationsInterceptorFactoryBean


    doTestStatefulRetry(messageCount, txSize, failFrequency, concurrentConsumers);

  }

  private Advice createRetryInterceptor(final CountDownLatch latch, boolean stateful) throws Exception {
    AbstractRetryOperationsInterceptorFactoryBean factory;
    if (stateful) {
      factory = new StatefulRetryOperationsInterceptorFactoryBean();
    } else {
      factory = new StatelessRetryOperationsInterceptorFactoryBean();
    }
    factory.setMessageRecoverer(new MessageRecoverer() {
      @Override
      public void recover(Message message, Throwable cause) {
        logger.info("Recovered: [" + SerializationUtils.deserialize(message.getBody()).toString()+"], message: " +message);
        latch.countDown();
      }
    });
    if (retryTemplate == null) {
      retryTemplate = new RetryTemplate();
    }
    factory.setRetryOperations(retryTemplate);
    Advice retryInterceptor = factory.getObject();
    return retryInterceptor;
  }
View Full Code Here

TOP

Related Classes of org.springframework.amqp.rabbit.config.AbstractRetryOperationsInterceptorFactoryBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.