Examples of RabbitTemplate


Examples of org.springframework.amqp.rabbit.core.RabbitTemplate

  }

  @Test
  public void testConnectionFactoryBackOff() {
    load(TestConfiguration2.class);
    RabbitTemplate rabbitTemplate = this.context.getBean(RabbitTemplate.class);
    CachingConnectionFactory connectionFactory = this.context
        .getBean(CachingConnectionFactory.class);
    assertEquals(rabbitTemplate.getConnectionFactory(), connectionFactory);
    assertEquals("otherserver", connectionFactory.getHost());
    assertEquals(8001, connectionFactory.getPort());
  }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate

  }

  @Test
  public void testRabbitTemplateBackOff() {
    load(TestConfiguration3.class);
    RabbitTemplate rabbitTemplate = this.context.getBean(RabbitTemplate.class);
    assertEquals(this.context.getBean("testMessageConverter"),
        rabbitTemplate.getMessageConverter());
  }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate

  @Configuration
  protected static class TestConfiguration3 {

    @Bean
    RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
      RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
      rabbitTemplate.setMessageConverter(testMessageConverter());
      return rabbitTemplate;
    }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate

public class WorkerConfiguration extends AbstractConfiguration {

 
  @Bean
  public RabbitTemplate rabbitTemplate() {
    RabbitTemplate template = new RabbitTemplate(connectionFactory());
    template.setMessageConverter(jsonMessageConverter());
    template.setRoutingKey(QueueNames.RESULT_QUEUE_NAME)
    return template;
  }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate

   * The server's template will by default send to the topic exchange named
   * {@link AbstractStockAppRabbitConfiguration#MARKET_DATA_EXCHANGE_NAME}.
   */
  @Bean
  public AmqpTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
    RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
    rabbitTemplate.setExchange(MARKET_DATA_EXCHANGE_NAME);
    rabbitTemplate.setMessageConverter(jsonMessageConverter());
    return rabbitTemplate;
  }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate

@Configuration
public class MasterConfiguration extends AbstractConfiguration {
 
  @Bean
  public RabbitTemplate rabbitTemplate() {
    RabbitTemplate template = new RabbitTemplate(connectionFactory());
    template.setMessageConverter(jsonMessageConverter());
    template.setRoutingKey(QueueNames.WORK_QUEUE_NAME)
    return template;
  }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate

        return new RabbitAdmin(connectionFactory());
    }

    @Bean
    public RabbitTemplate rabbitTemplate() {
        return new RabbitTemplate(connectionFactory());
    }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate

    return connectionFactory;
  }

  public void setConnectionFactory(ConnectionFactory connectionFactory) {
    this.connectionFactory = connectionFactory;
    this.rabbitTemplate = new RabbitTemplate(connectionFactory);
    this.rabbitAdmin = new RabbitAdmin(connectionFactory);
  }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate

      ConnectionFactory connectionFactory,
      long timeout,
      ScheduledExecutorService executor,
      String exchange,
      String routingKey) {
    super(new RabbitTemplate(connectionFactory), exchange, routingKey);
    ArgumentChecker.notNull(connectionFactory, "connectionFactory");   
    ArgumentChecker.notNull(executor, "executor");
   
    if (timeout <= 0) {
      throw new IllegalArgumentException("Timeout must be positive");
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate

        }
       
        if(this.amqpTemplate == null || this.amqpTemplate.isEmpty()) {
            //Attempt to construct an AMQP template
            this.amqpTemplate = new HashMap<String, AmqpTemplate>();
            this.amqpTemplate.put(DEFAULT_CONNECTION, new RabbitTemplate(this.connectionFactory.values().iterator().next()));
            LOG.info("Created new AMQP Template");
        }
       
        return this.amqpTemplate;
    }
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.