Examples of basicConsume()


Examples of com.rabbitmq.client.Channel.basicConsume()

    private void assertFailValidation(Map<String, Object> args) throws IOException {
        Channel ch = connection.createChannel();
        String queue = ch.queueDeclare().getQueue();
        try {
            ch.basicConsume(queue, true, args, new QueueingConsumer(ch));
            fail("Validation should fail for " + args);
        } catch (IOException ioe) {
            checkShutdownSignal(AMQP.PRECONDITION_FAILED, ioe);
        }
    }
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

            Channel channel = connection.createChannel();

            //  Establish the REQ/REP wiring.
            String queueName = channel.queueDeclare().getQueue();
            QueueingConsumer consumer = new QueueingConsumer(channel);
            channel.basicConsume(queueName, true, consumer);

            //  Send the request
            AMQP.BasicProperties properties = new AMQP.BasicProperties();
            properties.setReplyTo(queueName);
            channel.basicPublish("", "REQREP", properties,
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

            //  Establish the PUB/SUB wiring
            String queueName = channel.queueDeclare().getQueue();
            channel.queueBind(queueName, "PIPELINE", null);
            QueueingConsumer consumer = new QueueingConsumer(channel);
            channel.basicConsume(queueName, true, consumer);

            for (;;) {

                //  Get next request
                String msg = consumer.nextDelivery().getBody().toString();
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

            Channel channel = connection.createChannel();

            //  Establish the REQ/REP wiring.
            channel.queueDeclare("REQREP", true, false, false, null);
            QueueingConsumer consumer = new QueueingConsumer(channel);
            channel.basicConsume("REQREP", true, consumer);

            for (;;) {

                //  Get next request
                QueueingConsumer.Delivery delivery = consumer.nextDelivery();
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

            //  Establish the PUB/SUB wiring
            String queueName = channel.queueDeclare().getQueue();
            channel.queueBind(queueName, "PUBSUB", null);
            QueueingConsumer consumer = new QueueingConsumer(channel);
            channel.basicConsume(queueName, true, consumer);

            for (;;) {

                //  Get next request
                String msg = consumer.nextDelivery().getBody().toString();
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

    System.out.println(" [*] Waiting for messages. To exit press CTRL+C");
   
    channel.basicQos(1);
   
    QueueingConsumer consumer = new QueueingConsumer(channel);
    channel.basicConsume(TASK_QUEUE_NAME, false, consumer);
   
    while (true) {
      QueueingConsumer.Delivery delivery = consumer.nextDelivery();
      String message = new String(delivery.getBody());
     
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

    }
   
    System.out.println(" [*] Waiting for messages. To exit press CTRL+C");

    QueueingConsumer consumer = new QueueingConsumer(channel);
    channel.basicConsume(queueName, true, consumer);

    while (true) {
      QueueingConsumer.Delivery delivery = consumer.nextDelivery();
      String message = new String(delivery.getBody());
      String routingKey = delivery.getEnvelope().getRoutingKey();
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

      channel.queueDeclare(RPC_QUEUE_NAME, false, false, false, null);
 
      channel.basicQos(1);
 
      QueueingConsumer consumer = new QueueingConsumer(channel);
      channel.basicConsume(RPC_QUEUE_NAME, false, consumer);
 
      System.out.println(" [x] Awaiting RPC requests");
 
      while (true) {
        String response = null;
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

      }
   
      System.out.println(" [*] Waiting for messages. To exit press CTRL+C");

      QueueingConsumer consumer = new QueueingConsumer(channel);
      channel.basicConsume(queueName, true, consumer);

      while (true) {
        QueueingConsumer.Delivery delivery = consumer.nextDelivery();
        String message = new String(delivery.getBody());
        String routingKey = delivery.getEnvelope().getRoutingKey();
View Full Code Here

Examples of com.rabbitmq.client.Channel.basicConsume()

    channel.queueDeclare(QUEUE_NAME, false, false, false, null);
    System.out.println(" [*] Waiting for messages. To exit press CTRL+C");
   
    QueueingConsumer consumer = new QueueingConsumer(channel);
    channel.basicConsume(QUEUE_NAME, true, consumer);
   
    while (true) {
      QueueingConsumer.Delivery delivery = consumer.nextDelivery();
      String message = new String(delivery.getBody());
      System.out.println(" [x] Received '" + message + "'");
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.