Examples of receiveAndConvert()


Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert()

        assertTrue("Expected to receive all messages before stop", waited);
      }

      assertTrue("Not enough error handling, remaining:" + this.errorsHandled.getCount(),
          this.errorsHandled.await(10, TimeUnit.SECONDS));
      assertNull(template.receiveAndConvert(queue.getName()));
    }
    finally {
      container.shutdown();
    }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert()

    int timeout = Math.min(4 + messageCount / (4 * concurrentConsumers), 30);
    logger.debug("Waiting for messages with timeout = " + timeout + " (s)");
    boolean waited = latch.await(timeout, TimeUnit.SECONDS);
    assertTrue("Timed out waiting for message", waited);

    assertNull(template.receiveAndConvert(queue.getName()));

  }

  private ConnectionFactory createConnectionFactory() {
    CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert()

    int timeout = Math.min(4 + messageCount / (4 * concurrentConsumers), 30);
    logger.debug("Waiting for messages with timeout = " + timeout + " (s)");
    waited = latch.await(timeout, TimeUnit.SECONDS);
    assertTrue("Timed out waiting for message", waited);

    assertNull(template.receiveAndConvert(queue.getName()));

  }

  private SimpleMessageListenerContainer createContainer(String queueName, Object listener,
      ConnectionFactory connectionFactory) {
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert()

    blockingQueueConsumer.start();

    // TODO: make this into a proper assertion. An exception can be thrown here by the Rabbit client and printed to
    // stderr without being rethrown (so hard to make a test fail).
    blockingQueueConsumer.stop();
    assertNull(template.receiveAndConvert(queue.getName()));
    connectionFactory.destroy();

  }

}
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert()

    assertTrue("Timed out waiting for message", waited);

    // Give message time to reach broker (intermittent test failures)!
    Thread.sleep(500L);
    // All messages committed
    byte[] bytes = (byte[]) template.receiveAndConvert(sendQueue.getName());
    assertNotNull(bytes);
    assertEquals("bar", new String(bytes));
    assertEquals(null, template.receiveAndConvert(queue.getName()));

    ((DisposableBean) connectionFactory).destroy();
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert()

    Thread.sleep(500L);
    // All messages committed
    byte[] bytes = (byte[]) template.receiveAndConvert(sendQueue.getName());
    assertNotNull(bytes);
    assertEquals("bar", new String(bytes));
    assertEquals(null, template.receiveAndConvert(queue.getName()));

    ((DisposableBean) connectionFactory).destroy();

  }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert()

    container.stop();
    Thread.sleep(200L);

    // Foo message is redelivered
    assertEquals("foo", template.receiveAndConvert(queue.getName()));
    // Sending of bar message is also rolled back
    assertNull(template.receiveAndConvert(sendQueue.getName()));

    ((DisposableBean) connectionFactory).destroy();
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert()

    Thread.sleep(200L);

    // Foo message is redelivered
    assertEquals("foo", template.receiveAndConvert(queue.getName()));
    // Sending of bar message is also rolled back
    assertNull(template.receiveAndConvert(sendQueue.getName()));

    ((DisposableBean) connectionFactory).destroy();

  }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert()

    int timeout = getTimeout();
    logger.debug("Waiting for messages with timeout = " + timeout + " (s)");
    boolean waited = latch.await(timeout, TimeUnit.SECONDS);
    assertTrue("Timed out waiting for message", waited);

    assertNull(template.receiveAndConvert(queue.getName()));

    ((DisposableBean) connectionFactory1).destroy();
    ((DisposableBean) connectionFactory2).destroy();
  }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert()

    int timeout = getTimeout();
    logger.debug("Waiting for messages with timeout = " + timeout + " (s)");
    boolean waited = latch.await(timeout, TimeUnit.SECONDS);
    assertTrue("Timed out waiting for message", waited);

    assertNull(template.receiveAndConvert(queue.getName()));

    ((DisposableBean) connectionFactory1).destroy();
    ((DisposableBean) connectionFactory2).destroy();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.