Examples of queueBind()


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

        System.out.println("Binding header " + argv[i] + " and value " + argv[i + 1] + " to queue " + queueInputName);
        i++;
      }

      String queueName = channel.queueDeclare(queueInputName, true, false, false, null).getQueue();
      channel.queueBind(queueName, EXCHANGE_NAME, routingKeyFromUser, headers);
   
      System.out.println(" [*] Waiting for messages. To exit press CTRL+C");

      QueueingConsumer consumer = new QueueingConsumer(channel);
      channel.basicConsume(queueName, true, consumer);
View Full Code Here

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

    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "fanout");
    String queueName = channel.queueDeclare().getQueue();
    channel.queueBind(queueName, EXCHANGE_NAME, "");
   
    System.out.println(" [*] Waiting for messages. To exit press CTRL+C");

    QueueingConsumer consumer = new QueueingConsumer(channel);
    channel.basicConsume(queueName, true, consumer);
View Full Code Here

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

                queue = channel.queueDeclare().getQueue();
            } else {
              channel.queueDeclare(queue, false, false, false, null);
            }

            channel.queueBind(queue, exchange, topicPattern);

            System.out.println("Listening to exchange " + exchange + ", pattern " + topicPattern +
                               " from queue " + queue);

            QueueingConsumer consumer = new QueueingConsumer(channel);
View Full Code Here

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

          {{setUri(uri);}}.newConnection();
      Channel setup = conn.createChannel();

      setup.exchangeDeclare(EXCHANGE, "direct");
      setup.queueDeclare(QUEUE, false, false, false, null);
      setup.queueBind(QUEUE,EXCHANGE, "");
     
      setup.close();
    } catch(Exception e){
      e.printStackTrace();
      System.exit(1);
View Full Code Here

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

            Connection conn = cfconn.newConnection();

            Channel ch1 = conn.createChannel();

            String queueName = ch1.queueDeclare().getQueue();
            ch1.queueBind(queueName, exchange, "#");

            QueueingConsumer consumer = new QueueingConsumer(ch1);
            ch1.basicConsume(queueName, true, consumer);
            while (true) {
                QueueingConsumer.Delivery delivery = consumer.nextDelivery();
View Full Code Here

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

    if (routingKey == null) {
        System.err.println("Please supply routing key pattern to bind to (-k)");
        System.exit(2);
    }
    ch.exchangeDeclare(exchange, exchangeType);
    ch.queueBind(queueName, exchange, routingKey);
      }

            QueueingConsumer consumer = new QueueingConsumer(ch);
            ch.basicConsume(queueName, consumer);
            while (true) {
View Full Code Here

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

  public void testCloseWithFaultyConsumer() throws Exception{
    SpecialConnection connection = new SpecialConnection();
    Channel channel = connection.createChannel();
    channel.exchangeDeclare("x", "direct");
    channel.queueDeclare("q", false, false, false, null);
    channel.queueBind("q", "x", "k");

    channel.basicConsume("q", true, new DefaultConsumer(channel){
        @Override
        public void handleDelivery(String consumerTag,
                                   Envelope envelope,
View Full Code Here

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

                for (; q < maxQueues; q++) {
                    AMQP.Queue.DeclareOk ok = channel.queueDeclare();
                    queues.push(ok.getQueue());
                    for (int b = 0; b < maxBindings; b++) {
                        channel.queueBind(ok.getQueue(), "amq.direct", routingKeys[b]);
                    }
                }

                creation.addDataPoint(x);
View Full Code Here

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

                        channel.queueDeclare(queueName,
                                             flags.contains("persistent"),
                                             exclusive, autoDelete,
                                             null).getQueue();
                if (prefetchCount > 0) channel.basicQos(prefetchCount);
                channel.queueBind(qName, exchangeName, id);
                Thread t =
                    new Thread(new Consumer(channel, id, qName,
                                            consumerTxSize, autoAck,
                                            multiAckEvery, stats, timeLimit));
                consumerThreads[i] = t;
View Full Code Here

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

        // exchange
        channel.exchangeDeclare(exchange, "direct");

        // queue
        channel.queueDeclare(queue, true, false, false, Collections.singletonMap("x-message-ttl", (Object) 30000L));
        channel.queueBind(queue, exchange, queue, null);

        // send a message
        AMQP.BasicProperties props = new AMQP.BasicProperties.Builder().deliveryMode(2).build();
        for(int x = 0; x < 10; x++) {
            channel.basicPublish(exchange, queue, props, ("Msg [" + x + "]").getBytes());
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.