Example usage for org.springframework.jms.core JmsMessagingTemplate receiveAndConvert

List of usage examples for org.springframework.jms.core JmsMessagingTemplate receiveAndConvert

Introduction

In this page you can find the example usage for org.springframework.jms.core JmsMessagingTemplate receiveAndConvert.

Prototype

@Override
    @Nullable
    public <T> T receiveAndConvert(String destinationName, Class<T> targetClass) throws MessagingException 

Source Link

Usage

From source file:moxy.ProxyActiveMqTest.java

private void assertWeCanSendAndReceiveAMessageOn(JmsMessagingTemplate jms) {
    final String queueName = "testQueue-" + System.nanoTime();
    final String message = String.valueOf(System.nanoTime());

    jms.convertAndSend(queueName, message);

    RetryableAssertion retryable = new RetryableAssertion() {
        protected void assertion() {
            assertEquals(message, jms.receiveAndConvert(queueName, String.class));

        }/*from ww  w.  j a  v  a2s  .  com*/
    };
    retryable.performAssertion();
    assertableListener.assertConnectionWasMadeOn(7878);
}