Package com.rabbitmq.client

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


                consumerConnections[i] = conn;
                Channel channel = conn.createChannel();
                if (consumerTxSize > 0) channel.txSelect();
                channel.exchangeDeclare(exchangeName, exchangeType);
                String qName =
                        channel.queueDeclare(queueName,
                                             flags.contains("persistent"),
                                             exclusive, autoDelete,
                                             null).getQueue();
                if (prefetchCount > 0) channel.basicQos(prefetchCount);
                channel.queueBind(qName, exchangeName, id);
View Full Code Here


        //is an interaction with the persister and not something we
        //want to see delay things.
        publish(pubCh);

        //a synchronous request, to make sure the publish is done
        pubCh.queueDeclare();

        //signal the main thread
        init.release();
        //wait for main thread to let us resume
        resume.await();
View Full Code Here

                long startTime = System.currentTimeMillis();

                // Setup
                Connection conn = connectionFactory.newConnection();
                Channel ch = conn.createChannel();
                ch.queueDeclare(QUEUE_NAME, true, false, false, null);
                ch.confirmSelect();

                // Publish
                for (long i = 0; i < msgCount; ++i) {
                    ch.basicPublish("", QUEUE_NAME,
View Full Code Here

        public void run() {
            try {
                // Setup
                Connection conn = connectionFactory.newConnection();
                Channel ch = conn.createChannel();
                ch.queueDeclare(QUEUE_NAME, true, false, false, null);

                // Consume
                QueueingConsumer qc = new QueueingConsumer(ch);
                ch.basicConsume(QUEUE_NAME, true, qc);
                for (int i = 0; i < msgCount; ++i) {
View Full Code Here

        byte[] body = new byte[bodySize];
        List<Long> plateauSampleTimes = new ArrayList<Long>(repeatCount);
        List<Double> plateauSampleDeltas = new ArrayList<Double>(repeatCount);

        trace("Declaring and purging queue " + q);
        chan.queueDeclare(q, true, false, false, null);
        chan.queuePurge(q);
        chan.basicQos(1);

        trace("Building backlog out to " + backlogSize + " messages, each " + bodySize + " bytes long");
        for (int i = 0; i < backlogSize; i++) {
View Full Code Here

            connFactory.setHost(hostName);
            connFactory.setPort(portNumber);
            Connection conn = connFactory.newConnection();
            final Channel ch = conn.createChannel();

            ch.queueDeclare("Hello", false, false, false, null);
            StringRpcServer server = new StringRpcServer(ch, "Hello") {
                    public String handleStringCall(String request) {
                        System.out.println("Got request: " + request);
                        return "Hello, " + request + "!";
                    }
View Full Code Here

        // 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++) {
View Full Code Here

    private void runIt() throws IOException {
        Channel channel = _connection.createChannel();

        String queueName = "test queue";
        channel.queueDeclare(queueName, true, false, false, null);

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

        String completionQueue = channel.queueDeclare().getQueue();
View Full Code Here

        channel.queueDeclare(queueName, true, false, false, null);

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

                        }
                    };

                Connection connection = factory.newConnection();
                Channel channel = connection.createChannel();
                Queue.DeclareOk res = channel.queueDeclare();
                String queueName = res.getQueue();

                long start;

                start = System.nanoTime();
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.