Package com.rabbitmq.client

Examples of com.rabbitmq.client.DefaultConsumer


        final List<Envelope> received = new ArrayList<Envelope>();

        Channel channel = conn.createChannel();
        channel.queueDeclare("sammyq", false, false, true, null);
        channel.queueBind("sammyq", EXCHANGE, "");
        channel.basicConsume("sammyq", true, new DefaultConsumer(channel) {
            @Override
            public void handleDelivery(String consumerTag,
                                       Envelope envelope,
                                       AMQP.BasicProperties properties,
                                       byte[] body) throws IOException {
View Full Code Here


              latch.countDown();
              // This will be thrown on the Connection thread just before it dies, so basically ignored
              throw new RuntimeException(cause);
            }
          });
          String tag = channel.basicConsume(route, new DefaultConsumer(channel));
          // Consume twice with the same tag is a hard error (connection will be reset)
          String result = channel.basicConsume(route, false, tag, new DefaultConsumer(channel));
          fail("Expected IOException, got: " + result);
          return null;
        }
      });
      fail("Expected AmqpIOException");
View Full Code Here

      while (n++ < 100 && messageCount(rabbitAdmin, queueName) == 0) {
        Thread.sleep(100);
      }
      assertTrue("Message count = 0", n < 100);
      Channel channel = connectionFactory.createConnection().createChannel(false);
      DefaultConsumer consumer = new DefaultConsumer(channel);
      channel.basicConsume(queueName, true, consumer);
      n = 0;
      while (n++ < 100 && messageCount(rabbitAdmin, queueName) > 0) {
        Thread.sleep(100);
      }
View Full Code Here

        DeclareOk queueDeclaration = channel.queueDeclare();
        String replyTo = queueDeclaration.getQueue();
        message.getMessageProperties().setReplyTo(replyTo);

        String consumerTag = UUID.randomUUID().toString();
        DefaultConsumer consumer = new DefaultConsumer(channel) {

          @Override
          public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties,
                         byte[] body) throws IOException {
            MessageProperties messageProperties = messagePropertiesConverter.toMessageProperties(
View Full Code Here

TOP

Related Classes of com.rabbitmq.client.DefaultConsumer

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.