Package org.springframework.amqp.rabbit.support

Examples of org.springframework.amqp.rabbit.support.MessagePropertiesConverter


        config.setConcurrentConsumers(5);
        ConnectionFactory mockConnectionFactory = mock(ConnectionFactory.class);
        testSubject.setConnectionFactory(mockConnectionFactory);
        ErrorHandler mockErrorHandler = mock(ErrorHandler.class);
        config.setErrorHandler(mockErrorHandler);
        MessagePropertiesConverter mockMessagePropertiesConverter = mock(MessagePropertiesConverter.class);
        config.setMessagePropertiesConverter(mockMessagePropertiesConverter);
        config.setPrefetchCount(6);
        config.setReceiveTimeout(6000L);
        config.setRecoveryInterval(6500L);
        config.setShutdownTimeout(3000L);
View Full Code Here


        config.setConcurrentConsumers(5);
        ConnectionFactory mockConnectionFactory = mock(ConnectionFactory.class);
        testSubject.setConnectionFactory(mockConnectionFactory);
        ErrorHandler mockErrorHandler = mock(ErrorHandler.class);
        config.setErrorHandler(mockErrorHandler);
        MessagePropertiesConverter mockMessagePropertiesConverter = mock(MessagePropertiesConverter.class);
        config.setMessagePropertiesConverter(mockMessagePropertiesConverter);
        config.setPrefetchCount(6);
        config.setReceiveTimeout(6000L);
        config.setRecoveryInterval(6500L);
        config.setShutdownTimeout(3000L);
View Full Code Here

  }

  @Test
  public void testSendAndReceiveInCallback() throws Exception {
    template.convertAndSend(ROUTE, "message");
    final MessagePropertiesConverter messagePropertiesConverter = new DefaultMessagePropertiesConverter();
    String result = template.execute(new ChannelCallback<String>() {

      @Override
      public String doInRabbit(Channel channel) throws Exception {
        // We need noAck=false here for the message to be expicitly
        // acked
        GetResponse response = channel.basicGet(ROUTE, false);
        MessageProperties messageProps = messagePropertiesConverter.toMessageProperties(
            response.getProps(), response.getEnvelope(), "UTF-8");
        // Explicit ack
        channel.basicAck(response.getEnvelope().getDeliveryTag(), false);
        return (String) new SimpleMessageConverter().fromMessage(new Message(response.getBody(), messageProps));
      }
View Full Code Here

TOP

Related Classes of org.springframework.amqp.rabbit.support.MessagePropertiesConverter

Copyright © 2018 www.massapicom. 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.