Package org.springframework.amqp.rabbit.core

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


    Message message = MessageBuilder.withBody("foo".getBytes())
        .setContentType("text/plain")
        .setContentEncoding("junk")
        .build();
    template.send("", testQueueName, message);

    Message rejected = template.receive(dlq.getName());
    int n = 0;
    while (n++ < 100 && rejected == null) {
      Thread.sleep(100);
View Full Code Here


            && t.getCause() instanceof MessageConversionException;
      }
    });
    container.setErrorHandler(eh);

    template.send("", testQueueName, message);

    rejected = template.receive(dlq.getName());
    n = 0;
    while (n++ < 100 && rejected == null) {
      Thread.sleep(100);
View Full Code Here

    MessageProperties messageProperties = new MessageProperties();
    messageProperties.setContentType("text/plain");
    messageProperties.setMessageId("foo");
    Message message = new Message("Hello, world!".getBytes(), messageProperties);
    template.send("retry.test.exchange", "retry.test.binding", message);
    template.send("retry.test.exchange", "retry.test.binding", message);
    assertTrue(latch.await(10, TimeUnit.SECONDS));
    Thread.sleep(2000);
    assertEquals(0, ((Map) new DirectFieldAccessor(cache).getPropertyValue("map")).size());
    container.stop();
View Full Code Here

    MessageProperties messageProperties = new MessageProperties();
    messageProperties.setContentType("text/plain");
    messageProperties.setMessageId("foo");
    Message message = new Message("Hello, world!".getBytes(), messageProperties);
    template.send("retry.test.exchange", "retry.test.binding", message);
    template.send("retry.test.exchange", "retry.test.binding", message);
    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

    Thread.sleep(10000);
    int n = 0;
    while(true){
      for(int i=1; i<=200;i++){

        template.send("foo", "", new Message("foo # ID: id".replace("#", String.valueOf(i)).replace("id", java.util.UUID.randomUUID().toString()).getBytes(), messageProperties));

      }
      Thread.sleep(1000);
      if (++n % 10 == 0) {
        logger.warn(count(queues));
View Full Code Here

            }
            if (message == null) {
              message = new Message(msgBody.toString().getBytes(), amqpProps);
            }
            message = postProcessMessageBeforeSend(message, event);
            rabbitTemplate.send(exchangeName, routingKey, message);
          }
          catch (AmqpException e) {
            int retries = event.incrementRetries();
            if (retries < maxSenderRetries) {
              // Schedule a retry based on the number of times I've tried to re-send this
View Full Code Here

                message = new Message(msgBody.getBytes(), amqpProps);
              }
            }

            message = postProcessMessageBeforeSend(message, event);
            rabbitTemplate.send(exchangeName, routingKey, message);
          }
          catch (AmqpException e) {
            int retries = event.incrementRetries();
            if (retries < maxSenderRetries) {
              // Schedule a retry based on the number of times I've tried to re-send this
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.