Package com.rabbitmq.client

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


      if(!getQueue) {
         channel.queueDeclare(queueName, false, true, true, null);
      } else {
         queueName = channel.queueDeclare().getQueue();
      }
      channel.queueBind(queueName, exchangeName, routingKey);

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


            }
        };

        String queueName = channel.queueDeclare().getQueue();

        channel.queueBind(queueName, exchangeName, routingKey);
        channel.basicConsume(queueName, cons);

        long id = consumerSeq++;
        consumerChannels.put(id, channel);
View Full Code Here

        final Channel channel = connection.createChannel();

        try {
            channel.exchangeDeclare("testExchange", "topic", true);
            String dataQueue = channel.queueDeclare().getQueue();
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE2.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_REPLICATED_TABLE.#");
            String doneQueue = channel.queueDeclare().getQueue();
            channel.queueBind(doneQueue, "testExchange", "EXPORT_DONE_TABLE.#");
View Full Code Here

        try {
            channel.exchangeDeclare("testExchange", "topic", true);
            String dataQueue = channel.queueDeclare().getQueue();
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE2.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_REPLICATED_TABLE.#");
            String doneQueue = channel.queueDeclare().getQueue();
            channel.queueBind(doneQueue, "testExchange", "EXPORT_DONE_TABLE.#");

            // Setup callback for data stream
View Full Code Here

        try {
            channel.exchangeDeclare("testExchange", "topic", true);
            String dataQueue = channel.queueDeclare().getQueue();
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE2.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_REPLICATED_TABLE.#");
            String doneQueue = channel.queueDeclare().getQueue();
            channel.queueBind(doneQueue, "testExchange", "EXPORT_DONE_TABLE.#");

            // Setup callback for data stream
            channel.basicConsume(dataQueue, false, createConsumer(channel));
View Full Code Here

            String dataQueue = channel.queueDeclare().getQueue();
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_PARTITIONED_TABLE2.#");
            channel.queueBind(dataQueue, "testExchange", "EXPORT_REPLICATED_TABLE.#");
            String doneQueue = channel.queueDeclare().getQueue();
            channel.queueBind(doneQueue, "testExchange", "EXPORT_DONE_TABLE.#");

            // Setup callback for data stream
            channel.basicConsume(dataQueue, false, createConsumer(channel));

            // Setup callback for the done message
View Full Code Here

            Channel channel = createChannel(connection);

            // create a queue and bind it to the exchange with binding key formed from event topic
            createExchange(channel, amqpExchangeName);
            channel.queueDeclare(queueName, false, false, false, null);
            channel.queueBind(queueName, amqpExchangeName, bindingKey);

            // register a callback handler to receive the events that a subscriber subscribed to
            channel.basicConsume(queueName, s_autoAck, queueName, new DefaultConsumer(channel) {
                @Override
                public void handleDelivery(String queueName, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
View Full Code Here

                         *  with binding key formed from event topic
                         */
                        Channel channel = createChannel(connection);
                        createExchange(channel, amqpExchangeName);
                        channel.queueDeclare(subscriberId, false, false, false, null);
                        channel.queueBind(subscriberId, amqpExchangeName, bindingKey);

                        // register a callback handler to receive the events that a subscriber subscribed to
                        channel.basicConsume(subscriberId, s_autoAck, subscriberId, new DefaultConsumer(channel) {
                            @Override
                            public void handleDelivery(String queueName, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException {
View Full Code Here

      channel.exchangeDeclare(EXCHANGE_NAME, "topic");
      String queueName = channel.queueDeclare().getQueue();

      String bindingKey = _partition;
      channel.queueBind(queueName, EXCHANGE_NAME, bindingKey);

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

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

        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,
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.