Package org.springframework.amqp.rabbit.connection

Examples of org.springframework.amqp.rabbit.connection.CachingConnectionFactory.destroy()


    assertNotNull("Reply is expected", reply);
    assertEquals(new String(message.getBody()), new String(reply.getBody()));
    // Message was consumed so nothing left on queue
    reply = template.receive(ROUTE);
    assertEquals(null, reply);
    cachingConnectionFactory.destroy();
  }

  @Test
  public void testAtomicSendAndReceiveWithExchangeAndRoutingKey() throws Exception {
    final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
View Full Code Here


    assertNotNull("Reply is expected", reply);
    assertEquals(new String(message.getBody()), new String(reply.getBody()));
    // Message was consumed so nothing left on queue
    reply = template.receive(ROUTE);
    assertEquals(null, reply);
    cachingConnectionFactory.destroy();
  }

  @Test
  public void testAtomicSendAndReceiveWithConversion() throws Exception {
    final CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
View Full Code Here

    assertEquals("message", received.get(1000, TimeUnit.MILLISECONDS));
    assertEquals("message", result);
    // Message was consumed so nothing left on queue
    result = (String) template.receiveAndConvert();
    assertEquals(null, result);
    cachingConnectionFactory.destroy();
  }

  @Test
  public void testAtomicSendAndReceiveWithConversionUsingRoutingKey() throws Exception {
    ExecutorService executor = Executors.newFixedThreadPool(1);
View Full Code Here

    assertEquals("MESSAGE", received.get(1000, TimeUnit.MILLISECONDS));
    assertEquals("MESSAGE", result);
    // Message was consumed so nothing left on queue
    result = (String) template.receiveAndConvert();
    assertEquals(null, result);
    cachingConnectionFactory.destroy();
  }

  @Test
  public void testAtomicSendAndReceiveWithConversionAndMessagePostProcessorUsingRoutingKey() throws Exception {
    ExecutorService executor = Executors.newFixedThreadPool(1);
View Full Code Here

    template.convertAndSend("foo.end", "message");
    result = getResult(consumer);
    assertEquals("message", result);

    consumer.stop();
    cachingConnectionFactory.destroy();

  }

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

    DirectFieldAccessor dfa = new DirectFieldAccessor(template);
    Map<?, ?> pendingConfirms = (Map<?, ?>) dfa.getPropertyValue("pendingConfirms");
    assertThat(pendingConfirms.size(), greaterThan(0)); // might use 2 or only 1 channel
    exec.shutdown();
    assertTrue(exec.awaitTermination(10, TimeUnit.SECONDS));
    ccf.destroy();
    assertEquals(0, pendingConfirms.size());
  }

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

    Thread.sleep(200);
    String result = (String) template.receiveAndConvert(queue.getName());
    assertEquals(null, result);

    connectionFactory.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.