Package org.springframework.amqp.rabbit.core

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


  }

  @Bean
  public RabbitTemplate rabbitTemplate() {
    //System.out.println( " Invoked rabbitTemplate!");
    RabbitTemplate template = new RabbitTemplate(connectionFactory());
   
    //The routing key is set to the name of the queue by the broker for the default exchange.
    template.setRoutingKey(this.payProcQueueName);
    //Where we will synchronously receive messages from
    template.setQueue(this.payProcQueueName);
    return template;
  }
View Full Code Here


            SpringAMQPMessage inMessage = new SpringAMQPMessage(message);
            exchange.setIn(inMessage); //Swap out the old message format

            MessageConverter msgConverter;
            if(endpoint.getAmqpTemplate() instanceof RabbitTemplate) {
                RabbitTemplate rabbitTemplate = (RabbitTemplate) endpoint.getAmqpTemplate();
                msgConverter = rabbitTemplate.getMessageConverter();
            } else {
                LOG.warn("Cannot find RabbitMQ AMQP Template, falling back to simple message converter");
                msgConverter = new SimpleMessageConverter();
            }
           
View Full Code Here

    String queueName = "CLOUD";
    AmqpAdmin amqpAdmin = new RabbitAdmin(connectionFactory);
    Queue cloudQueue = new Queue(queueName);
    amqpAdmin.declareQueue(cloudQueue);

    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    template.setRoutingKey(queueName);
    template.setQueue(queueName);
    template.afterPropertiesSet();

    template.convertAndSend("Hello, CloudFoundry!");
    template.convertAndSend("Hello, Spring!");
    template.convertAndSend("Hello, Java!");
    template.convertAndSend("Hello, Caldecott!");
    template.convertAndSend("Hello, Rabbit!");
    template.convertAndSend("Hello, AMQP!");

    int count = 0;
    while (true) {
      String message = (String) template.receiveAndConvert();
      if (message == null) {
        break;
      }
      else {
        count++;
View Full Code Here

    return new RabbitAdmin(connectionFactory());
  }

  @Bean
  public RabbitTemplate rabbitTemplate() {
    RabbitTemplate template = new RabbitTemplate(connectionFactory());
    //The routing key is set to the name of the queue by the broker for the default exchange.
    template.setRoutingKey(this.helloWorldQueueName);
    //Where we will synchronously receive messages from
    template.setQueue(this.helloWorldQueueName);
    return template;
  }
View Full Code Here

  protected final String helloWorldQueueName = "hello.world.queue";

  @Bean
  public RabbitTemplate rabbitTemplate() {
    RabbitTemplate template = new RabbitTemplate(connectionFactory());
    template.setRoutingKey(this.helloWorldQueueName);
    return template;
  }
View Full Code Here

    return connectionFactory;
  }

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

            }
        }
       
        if(this.amqpTemplate == null) {
            //Attempt to construct an AMQP template
            this.amqpTemplate = new RabbitTemplate(this.connectionFactory);
            LOG.info("Created new AMQP Template");
        }
       
        return this.amqpTemplate;
    }
View Full Code Here

            SpringAMQPMessage inMessage = new SpringAMQPMessage(message);
            exchange.setIn(inMessage); //Swap out the old message format

            MessageConverter msgConverter;
            if(endpoint.getAmqpTemplate() instanceof RabbitTemplate) {
                RabbitTemplate rabbitTemplate = (RabbitTemplate) endpoint.getAmqpTemplate();
                msgConverter = rabbitTemplate.getMessageConverter();
            } else {
                LOG.warn("Cannot find RabbitMQ AMQP Template, falling back to simple message converter");
                msgConverter = new SimpleMessageConverter();
            }
View Full Code Here

            }
        }
       
        if(this.amqpTemplate == null) {
            //Attempt to construct an AMQP template
            this.amqpTemplate = new RabbitTemplate(this.connectionFactory);
            LOG.info("Created new AMQP Template");
        }
       
        return this.amqpTemplate;
    }
View Full Code Here

        SpringAMQPMessage inMessage = new SpringAMQPMessage(message);
        exchange.setIn(inMessage); //Swap out the old message format
       
        MessageConverter msgConverter;
        if(this.endpoint.getAmqpTemplate() instanceof RabbitTemplate) {
            RabbitTemplate rabbitTemplate = (RabbitTemplate) this.endpoint.getAmqpTemplate();
            msgConverter = rabbitTemplate.getMessageConverter();
        } else {
            LOG.warn("Cannot find RabbitMQ AMQP Template, falling back to simple message converter");
            msgConverter = new SimpleMessageConverter();
        }
       
View Full Code Here

TOP

Related Classes of org.springframework.amqp.rabbit.core.RabbitTemplate

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.