Package com.rabbitmq.client

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


          if (logger.isLoggable(BasicLevel.DEBUG)) {
            logger.log(BasicLevel.DEBUG, connection.getName() + ": New channel available for distribution.");
          }
          try {
            Channel chan = connection.getConnection().createChannel();
            chan.queueDeclarePassive(amqpQueue);
            channels.put(connection.getName(), chan);
          } catch (IOException exc) {
            if (logger.isLoggable(BasicLevel.DEBUG)) {
              logger.log(BasicLevel.DEBUG, "Channel is not usable.", exc);
            }
View Full Code Here


          logger.log(BasicLevel.DEBUG, "Creating a new consumer on queue " + amqpQueue + " for connection "
              + connection.getName());
        }
        try {
          Channel chan = connection.getConnection().createChannel();
          chan.queueDeclarePassive(amqpQueue);
          AmqpConsumer consumer = new AmqpConsumer(chan, connection.getName());
          chan.basicConsume(amqpQueue, false, consumer);
          channels.add(chan);
        } catch (Exception e) {
          logger.log(BasicLevel.ERROR,
View Full Code Here

    }

    private void declare(Connection connection, String q, boolean expectedExists) throws IOException {
        Channel ch = connection.createChannel();
        try {
            ch.queueDeclarePassive(q);
            assertTrue(expectedExists);
        } catch (IOException e) {
            assertFalse(expectedExists);
            checkShutdownSignal(AMQP.NOT_FOUND, e);
            // Hmmm...
View Full Code Here

    }

    private boolean queueExists(String name) throws IOException {
        Channel ch2 = connection.createChannel();
        try {
            ch2.queueDeclarePassive(name);
            return true;
        } catch (IOException ioe) {
            return false;
        }
    }
View Full Code Here

        Channel ch2 = c2.createChannel();
        // autodelete but not exclusive
        String q = ch1.queueDeclare("", false, false, true, null).getQueue();

        try {
            ch2.queueDeclarePassive(q);
        } catch (IOException e) {
            checkShutdownSignal(AMQP.NOT_FOUND, e);
            // If we can't see the queue, secondary node must be up but not
            // clustered, hence not interesting to us
            return false;
View Full Code Here

        Channel ch2 = c2.createChannel();
        // autodelete but not exclusive
        String q = ch1.queueDeclare("", false, false, true, null).getQueue();

        try {
            ch2.queueDeclarePassive(q);
        } catch (IOException e) {
            checkShutdownSignal(AMQP.NOT_FOUND, e);
            // If we can't see the queue, secondary node must be up but not
            // clustered, hence not interesting to us
            return false;
View Full Code Here

    protected void checkPreconditions(List<ConsumerHolder> consumerHolders) throws IOException {
        Channel channel = createChannel();
        for (ConsumerHolder consumerHolder : consumerHolders) {
            String queue = consumerHolder.getConfiguration().getQueueName();
            try {
                channel.queueDeclarePassive(queue);
                LOGGER.debug("Queue {} found on broker", queue);
            } catch (IOException e) {
                LOGGER.error("Queue {} not found on broker", queue);
                throw e;
            }
View Full Code Here

        Channel channel = brokerSetup.getChannel();

        String routingKey = "test.key";
        channel.exchangeDeclare(TEST_EXCHANGE, "topic");
        brokerSetup.declareAndBindQueue(TEST_QUEUE, TEST_EXCHANGE, routingKey);
        channel.queueDeclarePassive(TEST_QUEUE);
       
        String body = "test.body";
        channel.basicPublish(TEST_EXCHANGE, routingKey, new BasicProperties(), body.getBytes());
       
        GetResponse response = channel.basicGet(TEST_QUEUE, true);
View Full Code Here

        String routingKey = "test.key";
        brokerSetup.declareExchange(TEST_EXCHANGE, "topic");
        brokerSetup.declareAndBindQueue(TEST_QUEUE, TEST_EXCHANGE, routingKey);
        channel.exchangeDeclarePassive(TEST_EXCHANGE);
        channel.queueDeclarePassive(TEST_QUEUE);
       
        brokerSetup.tearDown();
       
        boolean exchangeExists = true;
        try {
View Full Code Here

        } catch (Exception e) {
            exchangeExists = false;
        }
        boolean queueExists = true;
        try {
            channel.queueDeclarePassive(TEST_QUEUE);
        } catch (Exception e) {
            queueExists = false;
        }
        Assert.assertFalse(exchangeExists);
        Assert.assertFalse(queueExists);
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.