Examples of queueDeclare()


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

    MockChannel channel = mockChannel(1);

    Queue.DeclareOk declareOk = mock(Queue.DeclareOk.class);
    when(declareOk.getQueue()).thenReturn("test-queue");
    when(
        adminChannel.queueDeclare(eq("test-queue"), anyBoolean(), anyBoolean(), anyBoolean(),
            anyMap())).thenReturn(declareOk);
    when(
        channel.delegate.queueDeclare(eq("test-queue"), anyBoolean(), anyBoolean(), anyBoolean(),
            anyMap())).thenReturn(declareOk);
View Full Code Here

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

      factory.setHost(_mqServer);
      connection = factory.newConnection();
      Channel channel = connection.createChannel();

      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");
View Full Code Here

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

      factory.setHost(_mqServer);
      connection = factory.newConnection();
      Channel channel = connection.createChannel();

      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
View Full Code Here

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

        cfconn.setPort(AMQP.PROTOCOL.PORT);
        Connection conn = cfconn.newConnection();

        Channel ch = conn.createChannel();
        ch.exchangeDeclare("elasticsearch", "direct", true);
        ch.queueDeclare("elasticsearch", true, false, false, null);

        String message = "{ \"index\" : { \"index\" : \"test\", \"type\" : \"type1\", \"id\" : \"1\" }\n" +
                "{ \"type1\" : { \"field1\" : \"value1\" } }\n" +
                "{ \"delete\" : { \"index\" : \"test\", \"type\" : \"type1\", \"id\" : \"2\" } }\n" +
                "{ \"create\" : { \"index\" : \"test\", \"type\" : \"type1\", \"id\" : \"1\" }\n" +
View Full Code Here

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

        // channel.exchangeDeclare(exchangeName, "direct", true);
        // String queueName = channel.queueDeclare().getQueue();
        // channel.queueBind(queueName, exchangeName, routingKey);
       
        channel.exchangeDeclare(queue, plugin.getExchangeType(), true);
        channel.queueDeclare(queue, plugin.isDurable(), false, false, null);
        channel.queueBind(queue, queue, routingKey);

        // Log Debug
        Logger.info("RabbitMQ Task Channel Available: " + channel);
View Full Code Here

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

                Connection connection = connectionFactory.newConnection();

                Channel channel = connection.createChannel();
                channel.exchangeDeclare(AMQPUtil.EXCHANGE_NAME_TOPIC, AMQPUtil.EXCHANGE_TYPE_TOPIC);

                String queueName = channel.queueDeclare().getQueue();
                channel.queueBind(queueName, AMQPUtil.EXCHANGE_NAME_TOPIC, topic.getNativeKey());

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

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

                Connection connection = connectionFactory.newConnection();

                Channel channel = connection.createChannel();
                channel.exchangeDeclare(AMQPUtil.EXCHANGE_NAME_FANOUT, AMQPUtil.EXCHANGE_TYPE_FANOUT);

                String queueName = channel.queueDeclare().getQueue();
                channel.queueBind(queueName, AMQPUtil.EXCHANGE_NAME_FANOUT, "");

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

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

                Connection connection = connectionFactory.newConnection();

                Channel channel = connection.createChannel();
                channel.exchangeDeclare(AMQPUtil.EXCHANGE_NAME_DIRECT, AMQPUtil.EXCHANGE_TYPE_DIRECT);

                String queueName = channel.queueDeclare().getQueue();
                channel.queueBind(queueName, AMQPUtil.EXCHANGE_NAME_DIRECT, key.getNativeKey());

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

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

            //todo need to fix this rather getting it from a file
            Connection connection = AMQPConnectionUtil.connect(amqpHosts, connectionName, proxyPath);
            Channel channel = null;
            channel = connection.createChannel();
            availableChannels.put(channelID, channel);
            String queueName = channel.queueDeclare().getQueue();

            BasicConsumer consumer = new
                    BasicConsumer(new JSONMessageParser(), localPublisher);          // here we use local publisher
            channel.basicConsume(queueName, true, consumer);
            String filterString = CommonUtils.getRoutingKey(monitorID.getUserName(), hostAddress);
View Full Code Here

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

                if (channel == null) {
                    logger.error("Already Unregistered the listener");
                    throw new AiravataMonitorException("Already Unregistered the listener");
                } else {
                    try {
                        channel.queueUnbind(channel.queueDeclare().getQueue(), "glue2.computing_activity", CommonUtils.getRoutingKey(next));
                        channel.close();
                        channel.getConnection().close();
                        availableChannels.remove(channelID);
                    } catch (IOException e) {
                        logger.error("Error unregistering the listener");
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.