Examples of convertAndSend()


Examples of org.springframework.amqp.core.AmqpTemplate.convertAndSend()

public class Producer {

  public static void main(String[] args) {
    ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldConfiguration.class);
    AmqpTemplate amqpTemplate = context.getBean(AmqpTemplate.class);
    amqpTemplate.convertAndSend("Hello World");
    System.out.println("Sent: Hello World");
  }

}
View Full Code Here

Examples of org.springframework.amqp.core.AmqpTemplate.convertAndSend()

public class RabbitDemo {

  public static void main(String[] args) {
    ApplicationContext context = new ClassPathXmlApplicationContext("amqp/config.xml");
    AmqpTemplate template = context.getBean(AmqpTemplate.class);
    template.convertAndSend("samples.queue", "Hello AMQP");
  }

}
View Full Code Here

Examples of org.springframework.amqp.core.AmqpTemplate.convertAndSend()

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(BEAN_CONFIG);
        AmqpTemplate amqpTemplate = applicationContext.getBean("inboundAmqpTemplate", RabbitTemplate.class);

        for (int i = 0; i < SEND_MESSAGE_COUNT; i++ ) {
            amqpTemplate.convertAndSend("foo message: " + i);
        }

        ((ConfigurableApplicationContext) applicationContext).close();
    }
}
View Full Code Here

Examples of org.springframework.amqp.core.AmqpTemplate.convertAndSend()

    @Test
    public void voidTestWrite() throws Exception {
        AmqpTemplate amqpTemplate = mock(AmqpTemplate.class);

        amqpTemplate.convertAndSend("foo");

        amqpTemplate.convertAndSend("bar");

        AmqpItemWriter<String> amqpItemWriter = new AmqpItemWriter<String>(amqpTemplate);
        amqpItemWriter.write(Arrays.asList("foo", "bar"));
View Full Code Here

Examples of org.springframework.amqp.core.AmqpTemplate.convertAndSend()

    public void voidTestWrite() throws Exception {
        AmqpTemplate amqpTemplate = mock(AmqpTemplate.class);

        amqpTemplate.convertAndSend("foo");

        amqpTemplate.convertAndSend("bar");

        AmqpItemWriter<String> amqpItemWriter = new AmqpItemWriter<String>(amqpTemplate);
        amqpItemWriter.write(Arrays.asList("foo", "bar"));

    }
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend()

    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!");
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend()

    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!");
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend()

    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;
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend()

    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) {
View Full Code Here

Examples of org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend()

    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();
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.