Examples of queueBind()


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

        String exchangeName = "test completion";
        channel.exchangeDeclare(exchangeName, "fanout", false, false, null);

        String completionQueue = channel.queueDeclare().getQueue();
        channel.queueBind(completionQueue, exchangeName, "");

        LatencyExperimentConsumer callback = new LatencyExperimentConsumer(channel, queueName);
        callback._autoAck = this._autoAck;

        channel.basicConsume(queueName, _autoAck, callback);
View Full Code Here

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

        Connection conn = cf.newConnection();
        Channel setup = conn.createChannel();

        setup.exchangeDeclare(EXCHANGE, "direct");
        setup.queueDeclare(QUEUE, false, false, false, null);
        setup.queueBind(QUEUE, EXCHANGE, ROUTING_KEY);

        setup.close();
        return conn;
    }
}
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()

        // 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

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

        String exchangeName = "test completion";
        channel.exchangeDeclare(exchangeName, "fanout", false, false, null);

        String completionQueue = channel.queueDeclare().getQueue();
        channel.queueBind(completionQueue, exchangeName, "");

        LatencyExperimentConsumer callback = new LatencyExperimentConsumer(channel, queueName);
        callback._autoAck = this._autoAck;

        channel.basicConsume(queueName, _autoAck, callback);
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()

            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()

            qName = channel.queueDeclare(queueName,
                                         flags.contains("persistent"),
                                         false, autoDelete,
                                         null).getQueue();
        }
        channel.queueBind(qName, exchangeName, id);
        channel.close();
        return qName;
    }

    private static boolean exchangeExists(Connection connection, final String exchangeName) throws IOException {
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
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.