Package com.rabbitmq.client

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


    {
        channel.confirmSelect();
        try {
            Channel ch = connection.createChannel();
            ch.confirmSelect();
            ch.txSelect();
            fail();
        } catch (IOException ioe) {
            checkShutdownSignal(AMQP.PRECONDITION_FAILED, ioe);
        }
        try {
View Full Code Here


        } catch (IOException ioe) {
            checkShutdownSignal(AMQP.PRECONDITION_FAILED, ioe);
        }
        try {
            Channel ch = connection.createChannel();
            ch.txSelect();
            ch.confirmSelect();
            fail();
        } catch (IOException ioe) {
            checkShutdownSignal(AMQP.PRECONDITION_FAILED, ioe);
        }
View Full Code Here

            for (int i = 0; i < consumerCount; i++) {
                System.out.println("starting consumer #" + i);
                Connection conn = factory.newConnection();
                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,
View Full Code Here

                System.out.println("starting producer #" + i);
                Connection conn = factory.newConnection();
                producerConnections[i] = conn;
                Channel channel = conn.createChannel();
                producerChannels[i] = channel;
                if (producerTxSize > 0) channel.txSelect();
                if (confirm >= 0) channel.confirmSelect();
                channel.exchangeDeclare(exchangeName, exchangeType);
                final Producer p = new Producer(channel, exchangeName, id,
                                                flags, producerTxSize,
                                                rateLimit, minMsgSize, timeLimit,
View Full Code Here

    {
        channel.confirmSelect();
        try {
            Channel ch = connection.createChannel();
            ch.confirmSelect();
            ch.txSelect();
            fail();
        } catch (IOException ioe) {
            checkShutdownSignal(AMQP.PRECONDITION_FAILED, ioe);
        }
        try {
View Full Code Here

        } catch (IOException ioe) {
            checkShutdownSignal(AMQP.PRECONDITION_FAILED, ioe);
        }
        try {
            Channel ch = connection.createChannel();
            ch.txSelect();
            ch.confirmSelect();
            fail();
        } catch (IOException ioe) {
            checkShutdownSignal(AMQP.PRECONDITION_FAILED, ioe);
        }
View Full Code Here

        return randomRoutingKey;
    }

    public Producer createProducer(Connection connection, Stats stats, String id) throws IOException {
        Channel channel = connection.createChannel();
        if (producerTxSize > 0) channel.txSelect();
        if (confirm >= 0) channel.confirmSelect();
        if (!predeclared || !exchangeExists(connection, exchangeName)) {
            channel.exchangeDeclare(exchangeName, exchangeType);
        }
        final Producer producer = new Producer(channel, exchangeName, id,
View Full Code Here

        return producer;
    }

    public Consumer createConsumer(Connection connection, Stats stats, String id) throws IOException {
        Channel channel = connection.createChannel();
        if (consumerTxSize > 0) channel.txSelect();
        String qName = configureQueue(connection, id);
        if (consumerPrefetch > 0) channel.basicQos(consumerPrefetch);
        if (channelPrefetch > 0) channel.basicQos(channelPrefetch, true);
        return new Consumer(channel, id, qName,
                                         consumerTxSize, autoAck, multiAckEvery,
View Full Code Here

                public void run() {
                    try {
                        for (int t = 0; t < COMMIT_COUNT; t++) {
                            final Channel localChannel = connection.createChannel();
                            if (transactional) {
                                localChannel.txSelect();
                            }
                            for (int j = 0; j < COMMIT_SIZE; j++) {
                                localChannel.basicPublish("", queueName, null, ("message" + t).getBytes("UTF-8"));
                            }
                            if (transactional) {
View Full Code Here

                        for (int t = 0; t < COMMIT_COUNT; t++) {
                            Channel localChannel = channels.poll();
                            if (localChannel == null) {
                                localChannel = connection.createChannel();
                            }
                            localChannel.txSelect();
                            for (int j = 0; j < COMMIT_SIZE; j++) {
                                localChannel.basicPublish("", queueName, null, ("message" + t).getBytes("UTF-8"));
                            }
                            localChannel.txCommit();
                            if (!channels.offer(localChannel)) {
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.