Search in sources :

Example 1 with ForgivingExceptionHandler

use of com.rabbitmq.client.impl.ForgivingExceptionHandler in project rabbitmq-java-client by rabbitmq.

the class ExceptionHandling method forgivingConsumerHandleConsumerException.

@Test
public void forgivingConsumerHandleConsumerException() throws IOException, InterruptedException, TimeoutException {
    final CountDownLatch latch = new CountDownLatch(1);
    final ExceptionHandler eh = new ForgivingExceptionHandler() {

        @Override
        public void handleConsumerException(Channel channel, Throwable exception, Consumer consumer, String consumerTag, String methodName) {
            super.handleConsumerException(channel, exception, consumer, consumerTag, methodName);
            latch.countDown();
        }
    };
    testConsumerHandleConsumerException(eh, latch, false);
}
Also used : DefaultExceptionHandler(com.rabbitmq.client.impl.DefaultExceptionHandler) ForgivingExceptionHandler(com.rabbitmq.client.impl.ForgivingExceptionHandler) ExceptionHandler(com.rabbitmq.client.ExceptionHandler) ForgivingExceptionHandler(com.rabbitmq.client.impl.ForgivingExceptionHandler) DefaultConsumer(com.rabbitmq.client.DefaultConsumer) Consumer(com.rabbitmq.client.Consumer) Channel(com.rabbitmq.client.Channel) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.junit.Test)

Aggregations

Channel (com.rabbitmq.client.Channel)1 Consumer (com.rabbitmq.client.Consumer)1 DefaultConsumer (com.rabbitmq.client.DefaultConsumer)1 ExceptionHandler (com.rabbitmq.client.ExceptionHandler)1 DefaultExceptionHandler (com.rabbitmq.client.impl.DefaultExceptionHandler)1 ForgivingExceptionHandler (com.rabbitmq.client.impl.ForgivingExceptionHandler)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 Test (org.junit.Test)1