Examples of convertAndSend()


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();
      if (message == null) {
View Full Code Here

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

    });
    bus.bindConsumer("dlqtest", moduleInputChannel, properties);

    RabbitTemplate template = new RabbitTemplate(this.rabbitAvailableRule.getResource());
    template.convertAndSend("", "xdbustest.dlqtest", "foo");

    int n = 0;
    while (n++ < 100) {
      Object deadLetter = template.receiveAndConvert("xdbustest.dlqtest.dlq");
      if (deadLetter != null) {
View Full Code Here

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

   * @param data String to be transmitted to the Broker.
   */
  public void sendData(String data) {
    Assert.hasText(data, "data must not be null nor empty");
    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    template.convertAndSend(DEFAULT_EXCHANGE, "rabbitfixture.source", data);
  }

  /**
   * Sets the queue for this fixture.
   *
 
View Full Code Here

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

    });
    container.start();
    Log logger = spy(TestUtils.getPropertyValue(container, "logger", Log.class));
    new DirectFieldAccessor(container).setPropertyValue("logger", logger);
    when(logger.isWarnEnabled()).thenReturn(true);
    template.convertAndSend(queue.getName(), "baz");
    assertTrue(messageReceived.await(10, TimeUnit.SECONDS));
    Object consumer = TestUtils.getPropertyValue(container, "consumers", Map.class)
        .keySet().iterator().next();
    Log qLogger = spy(TestUtils.getPropertyValue(consumer, "logger", Log.class));
    new DirectFieldAccessor(consumer).setPropertyValue("logger", qLogger);
View Full Code Here

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

    int concurrentConsumers = 1;
    RabbitTemplate template = createTemplate(concurrentConsumers);

    // Send messages to the queue
    for (int i = 0; i < messageCount; i++) {
      template.convertAndSend(queue.getName(), i + "foo");
    }

    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(template.getConnectionFactory());
    container.setMessageListener(listener);
    container.setAcknowledgeMode(AcknowledgeMode.NONE);
View Full Code Here

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

    Advice retryInterceptor = fb.getObject();
    // add both advices
    container.setAdviceChain(new Advice[] {missingIdAdvice, retryInterceptor});
    container.start();

    template.convertAndSend("retry.test.exchange", "retry.test.binding", "Hello, world!");
    template.convertAndSend("retry.test.exchange", "retry.test.binding", "Hello, world!");
    assertTrue(latch.await(10, TimeUnit.SECONDS));
    Thread.sleep(2000);
    assertEquals(0, ((Map) new DirectFieldAccessor(cache).getPropertyValue("map")).size());
    container.stop();
View Full Code Here

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

    // add both advices
    container.setAdviceChain(new Advice[] {missingIdAdvice, retryInterceptor});
    container.start();

    template.convertAndSend("retry.test.exchange", "retry.test.binding", "Hello, world!");
    template.convertAndSend("retry.test.exchange", "retry.test.binding", "Hello, world!");
    assertTrue(latch.await(10, TimeUnit.SECONDS));
    Thread.sleep(2000);
    assertEquals(0, ((Map) new DirectFieldAccessor(cache).getPropertyValue("map")).size());
    container.stop();
    ctx.close();
View Full Code Here

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

      @Override
      public void onMessage(Message message) {
        RabbitTemplate rabbitTemplate = new RabbitTemplate(cachingConnectionFactory);
        rabbitTemplate.setChannelTransacted(true);
        // should use same channel as container
        rabbitTemplate.convertAndSend("foo", "bar", "baz");
        latch.countDown();
      }
    });
    container.setQueueNames("queue");
    container.setChannelTransacted(true);
View Full Code Here

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

      public void onMessage(Message message, Channel channel) {
        exposed.set(channel);
        RabbitTemplate rabbitTemplate = new RabbitTemplate(singleConnectionFactory);
        rabbitTemplate.setChannelTransacted(true);
        // should use same channel as container
        rabbitTemplate.convertAndSend("foo", "bar", "baz");
        latch.countDown();
      }

    });
    container.setQueueNames("queue");
View Full Code Here

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

      public void onMessage(Message message, Channel channel) {
        exposed.set(channel);
        RabbitTemplate rabbitTemplate = new RabbitTemplate(singleConnectionFactory);
        rabbitTemplate.setChannelTransacted(true);
        // should use same channel as container
        rabbitTemplate.convertAndSend("foo", "bar", "baz");
        latch.countDown();
      }

    });
    container.setQueueNames("queue");
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.