Examples of receiveAndConvert()


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()));

    assertEquals(concurrentConsumers, container.getActiveConsumerCount());
    container.stop();
    assertEquals(0, container.getActiveConsumerCount());
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()));

    ((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) connectionFactory).destroy();

  }
View Full Code Here

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

    }
    finally {
      container.shutdown();
      assertEquals(0, container.getActiveConsumerCount());
    }
    assertNull(template.receiveAndConvert(queue1.getName()));
    assertNull(template.receiveAndConvert(queue2.getName()));

    connectionFactory.destroy();
  }
View Full Code Here

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

    finally {
      container.shutdown();
      assertEquals(0, container.getActiveConsumerCount());
    }
    assertNull(template.receiveAndConvert(queue1.getName()));
    assertNull(template.receiveAndConvert(queue2.getName()));

    connectionFactory.destroy();
  }

View Full Code Here

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

    template.convertAndSend(fanoutTest.getName(), "", "message");
    template.convertAndSend(fanoutTest.getName(), queue.getName(), "message");
    Thread.sleep(200);
    // The queue is anonymous so it will be deleted at the end of the test, but it should get the message as long as
    // we use the same connection
    String result = (String) template.receiveAndConvert(queue.getName());
    assertEquals("message", result);
    result = (String) template.receiveAndConvert(queue.getName());
    assertEquals("message", result);
  }
View Full Code Here

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

    Thread.sleep(200);
    // The queue is anonymous so it will be deleted at the end of the test, but it should get the message as long as
    // we use the same connection
    String result = (String) template.receiveAndConvert(queue.getName());
    assertEquals("message", result);
    result = (String) template.receiveAndConvert(queue.getName());
    assertEquals("message", result);
  }

  @Test
  public void testDirectExchangeBindings() throws Exception {
View Full Code Here

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

    RabbitTemplate template = new RabbitTemplate(connectionFactory);

    template.convertAndSend(directTest.getName(), queue.getName(), "message");
    Thread.sleep(200);

    String result = (String) template.receiveAndConvert(queue.getName());
    assertEquals("message", result);

    template.convertAndSend(directTest.getName(), "", "message2");
    Thread.sleep(200);
View Full Code Here

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

    assertEquals("message", result);

    template.convertAndSend(directTest.getName(), "", "message2");
    Thread.sleep(200);

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

    result = (String) template.receiveAndConvert(queue2.getName());
    assertEquals("message2", result);

    template.convertAndSend(directTest.getName(), queue2.getName(), "message2");
View Full Code Here

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

    template.convertAndSend(directTest.getName(), "", "message2");
    Thread.sleep(200);

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

    result = (String) template.receiveAndConvert(queue2.getName());
    assertEquals("message2", result);

    template.convertAndSend(directTest.getName(), queue2.getName(), "message2");
    Thread.sleep(200);
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.